mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
gsocket: Fix detecting timeouts
If she socket is dispatched at exactly the previously set ready time, it should already be considered to have timed out. This can easily happen in practice when using a low resolution timer. This fixes a test failure on GNU/Hurd, see https://gitlab.gnome.org/GNOME/glib/-/issues/3148 Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
This commit is contained in:
parent
6b7b211338
commit
150965a9b3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user