timeval: Sleep instead of poll().
authorGurucharan Shetty <gshetty@nicira.com>
Wed, 12 Mar 2014 17:21:05 +0000 (10:21 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Thu, 13 Mar 2014 16:18:17 +0000 (09:18 -0700)
The WSAPoll() function, which is similar to poll() doesnot
simply sleep when the fd array is NULL. So use Sleep() instead.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/timeval.c

index 74efa59..ef806e7 100644 (file)
@@ -637,7 +637,12 @@ timeval_warp_cb(struct unixctl_conn *conn,
     timespec_add(&monotonic_clock.warp, &monotonic_clock.warp, &ts);
     ovs_mutex_unlock(&monotonic_clock.mutex);
     seq_change(timewarp_seq);
-    poll(NULL, 0, 10); /* give threads (eg. monitor) some chances to run */
+    /* give threads (eg. monitor) some chances to run */
+#ifndef _WIN32
+    poll(NULL, 0, 10);
+#else
+    Sleep(10);
+#endif
     unixctl_command_reply(conn, "warped");
 }