From: Dan Winship Date: Fri, 14 Feb 2014 20:35:11 +0000 (-0500) Subject: gsocket: fix g_socket_condition_timed_wait() recovery after EINTR X-Git-Tag: 2.39.90~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4139b26f3e2f869191b3d96d912f699470db6cea;p=platform%2Fupstream%2Fglib.git gsocket: fix g_socket_condition_timed_wait() recovery after EINTR After getting an EINTR, g_socket_condition_timed_wait() has to adjust its timeout, but it was trying to convert from nanoseconds to microseconds by multiplying by 1000 rather than dividing... Oops. https://bugzilla.gnome.org/show_bug.cgi?id=724239 --- diff --git a/gio/gsocket.c b/gio/gsocket.c index 4b691f8..70618e1 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -3674,7 +3674,7 @@ g_socket_condition_timed_wait (GSocket *socket, if (timeout != -1) { - timeout -= (g_get_monotonic_time () - start_time) * 1000; + timeout -= (g_get_monotonic_time () - start_time) / 1000; if (timeout < 0) timeout = 0; }