/* drbd_socket_okay() - Free the socket if its connection is not okay @mdev: DRBD device. @sock: pointer to the pointer to the socket.  */
static int drbd_socket_okay(struct drbd_conf *mdev, struct socket **sock)
/* drbd_socket_okay() - Free the socket if its connection is not okay @mdev: DRBD device. @sock: pointer to the pointer to the socket.  */
static int drbd_socket_okay(struct drbd_conf *mdev, struct socket **sock)
{
	int rr;
	char tb[4];
	if (!*sock)
		return FALSE;
	rr = drbd_recv_short(mdev, *sock, tb, 4, MSG_DONTWAIT | MSG_PEEK);
	if (rr > 0 || rr == -EAGAIN) {
		return TRUE;
	} else {
		sock_release(*sock);
		*sock = NULL;
		return FALSE;
	}
}