]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
tentative workaround for the random hangs on windows
authorRomain Pokrzywka <romain@kdab.com>
Sun, 3 Oct 2010 23:46:42 +0000 (01:46 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Thu, 7 Oct 2010 18:03:03 +0000 (20:03 +0200)
dbus/dbus-sysdeps-win.c

index 3c8da94a47c2e36c303f4cce30894adfcb99208a..ae461204f7d94ce8469da4ab2965f3ab17f5806a 100644 (file)
@@ -1129,12 +1129,11 @@ _dbus_poll (DBusPollFD *fds,
       max_fd = MAX (max_fd, fdp->fd);
     }
 
+  // Avoid random lockups with send(), for lack of a better solution so far
+  tv.tv_sec = timeout_milliseconds < 0 ? 1 : timeout_milliseconds / 1000;
+  tv.tv_usec = timeout_milliseconds < 0 ? 0 : (timeout_milliseconds % 1000) * 1000;
 
-  tv.tv_sec = timeout_milliseconds / 1000;
-  tv.tv_usec = (timeout_milliseconds % 1000) * 1000;
-
-  ready = select (max_fd + 1, &read_set, &write_set, &err_set,
-                  timeout_milliseconds < 0 ? NULL : &tv);
+  ready = select (max_fd + 1, &read_set, &write_set, &err_set, &tv);
 
   if (DBUS_SOCKET_API_RETURNS_ERROR (ready))
     {