{
gint ret;
- if (socket->priv->blocking &&
- !g_socket_condition_wait (socket,
- G_IO_OUT, cancellable, error))
- return -1;
-
ret = sendmmsg (socket->priv->fd, msgvec + num_sent, num_messages - num_sent,
flags | G_SOCKET_DEFAULT_SEND_FLAGS);
if (socket->priv->blocking &&
(errsv == EWOULDBLOCK ||
errsv == EAGAIN))
- continue;
+ {
+ if (!g_socket_condition_wait (socket,
+ G_IO_OUT, cancellable, error))
+ return -1;
+
+ continue;
+ }
if (num_sent > 0 &&
(errsv == EWOULDBLOCK ||
/* do it */
while (1)
{
- if (socket->priv->blocking &&
- !g_socket_condition_wait (socket,
- G_IO_IN, cancellable, error))
- return -1;
-
result = recvmsg (socket->priv->fd, &msg, msg.msg_flags);
#ifdef MSG_CMSG_CLOEXEC
if (result < 0 && get_socket_errno () == EINVAL)
if (socket->priv->blocking &&
(errsv == EWOULDBLOCK ||
errsv == EAGAIN))
- continue;
+ {
+ if (!g_socket_condition_wait (socket,
+ G_IO_IN, cancellable, error))
+ return -1;
+
+ continue;
+ }
g_set_error (error, G_IO_ERROR,
socket_io_error_from_errno (errsv),