Commit bb73a224 authored by Chun-wei Fan's avatar Chun-wei Fan

Win32: gio/gsocket.c: Set WSAEWOULDBLOCK on G_POLLABLE_RETURN_WOULD_BLOCK

To make things consistent across the board as that is the WinSock2 error
code that is received by g_socket_send_message_with_timeout() when it
returns G_POLLABLE_RETURN_WOULD_BLOCK.
parent bc1443b2
Pipeline #56284 passed with stages
in 12 minutes and 5 seconds
......@@ -4609,7 +4609,13 @@ g_socket_send_message (GSocket *socket,
cancellable, error);
if (res == G_POLLABLE_RETURN_WOULD_BLOCK)
socket_set_error_lazy (error, EWOULDBLOCK, _("Error sending message: %s"));
{
#ifndef G_OS_WIN32
socket_set_error_lazy (error, EWOULDBLOCK, _("Error sending message: %s"));
#else
socket_set_error_lazy (error, WSAEWOULDBLOCK, _("Error sending message: %s"));
#endif
}
return res == G_POLLABLE_RETURN_OK ? bytes_written : -1;
}
......@@ -5056,7 +5062,13 @@ g_socket_send_messages_with_timeout (GSocket *socket,
cancellable, &msg_error);
if (pollable_result == G_POLLABLE_RETURN_WOULD_BLOCK)
socket_set_error_lazy (&msg_error, EWOULDBLOCK, _("Error sending message: %s"));
{
#ifndef G_OS_WIN32
socket_set_error_lazy (&msg_error, EWOULDBLOCK, _("Error sending message: %s"));
#else
socket_set_error_lazy (&msg_error, WSAEWOULDBLOCK, _("Error sending message: %s"));
#endif
}
result = pollable_result == G_POLLABLE_RETURN_OK ? bytes_written : -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment