diff --git a/gio/gioenums.h b/gio/gioenums.h index a524acca8..4223253de 100644 --- a/gio/gioenums.h +++ b/gio/gioenums.h @@ -517,6 +517,7 @@ typedef enum { * @G_IO_ERROR_NOT_CONNECTED: Transport endpoint is not connected. Since 2.44 * @G_IO_ERROR_MESSAGE_TOO_LARGE: Message too large. Since 2.48. * @G_IO_ERROR_NO_SUCH_DEVICE: No such device found. Since 2.74 + * @G_IO_ERROR_DESTINATION_UNSET: Destination address unset. Since 2.80 * * Error codes returned by GIO functions. * @@ -587,6 +588,7 @@ typedef enum { G_IO_ERROR_NOT_CONNECTED, G_IO_ERROR_MESSAGE_TOO_LARGE, G_IO_ERROR_NO_SUCH_DEVICE GIO_AVAILABLE_ENUMERATOR_IN_2_74, + G_IO_ERROR_DESTINATION_UNSET GIO_AVAILABLE_ENUMERATOR_IN_2_80, } GIOErrorEnum; diff --git a/gio/gioerror.c b/gio/gioerror.c index 486e37aa1..d662b9402 100644 --- a/gio/gioerror.c +++ b/gio/gioerror.c @@ -228,6 +228,12 @@ g_io_error_from_errno (gint err_no) break; #endif +#ifdef EDESTADDRREQ + case EDESTADDRREQ: + return G_IO_ERROR_DESTINATION_UNSET; + break; +#endif + #ifdef EMSGSIZE case EMSGSIZE: return G_IO_ERROR_MESSAGE_TOO_LARGE; diff --git a/gio/gsocket.c b/gio/gsocket.c index 084a5e8e1..ee833a1a3 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -4060,7 +4060,7 @@ socket_source_dispatch (GSource *source, #endif timeout = g_source_get_ready_time (source); - if (timeout >= 0 && timeout < g_source_get_time (source) && + if (timeout >= 0 && timeout <= g_source_get_time (source) && !g_socket_is_closed (socket_source->socket)) { socket->priv->timed_out = TRUE; diff --git a/gio/tests/error.c b/gio/tests/error.c index dc79a4d82..702c9c651 100644 --- a/gio/tests/error.c +++ b/gio/tests/error.c @@ -557,7 +557,7 @@ test_error_from_errno (void) #ifdef EDESTADDRREQ g_assert_cmpuint (g_io_error_from_errno (EDESTADDRREQ), ==, - G_IO_ERROR_FAILED); + G_IO_ERROR_DESTINATION_UNSET); #endif #ifdef EPROTOTYPE diff --git a/gio/tests/socket.c b/gio/tests/socket.c index 223f9b464..1930e37ad 100644 --- a/gio/tests/socket.c +++ b/gio/tests/socket.c @@ -777,7 +777,7 @@ test_ip_sync_dgram (GSocketFamily family) len = g_socket_send_messages (client, m, G_N_ELEMENTS (m), 0, NULL, &error); /* This error code may vary between platforms and over time; it is not guaranteed API: */ #ifndef G_OS_WIN32 - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_FAILED); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_DESTINATION_UNSET); #else g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_CONNECTED); #endif diff --git a/glib/gmain.c b/glib/gmain.c index b9a68cce8..f6b251f31 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -1952,8 +1952,8 @@ g_source_set_ready_time (GSource *source, * Gets the "ready time" of @source, as set by * g_source_set_ready_time(). * - * Any time before the current monotonic time (including 0) is an - * indication that the source will fire immediately. + * Any time before or equal to the current monotonic time (including 0) + * is an indication that the source will fire immediately. * * Returns: the monotonic ready time, -1 for "never" **/