gio: return G_IO_NVAL if the socket is already closed

For consistency with Unix behaviour, as checked in the tests/socket.c.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-01-19 15:58:40 +04:00
parent 83d45c4f35
commit 2f8a9196b8

View File

@ -3997,7 +3997,10 @@ socket_source_dispatch (GSource *source,
gboolean ret;
#ifdef G_OS_WIN32
events = update_condition (socket_source->socket);
if ((socket_source->pollfd.revents & G_IO_NVAL) != 0)
events = G_IO_NVAL;
else
events = update_condition (socket_source->socket);
#else
if (g_socket_is_closed (socket_source->socket))
{