]> git.proxmox.com Git - qemu.git/commitdiff
aio / timers: use g_usleep() not sleep()
authorAlex Bligh <alex@alex.org.uk>
Thu, 29 Aug 2013 22:32:14 +0000 (23:32 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 1 Sep 2013 16:02:45 +0000 (20:02 +0400)
sleep() apparently doesn't exist under mingw. Use g_usleep for
portability.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
tests/test-aio.c

index 07a1f61f87f746b2e12fe8f68b3ecc9181dff9f2..532a1de3f9c9b51a7bdef6e6e7e9fa664ab81a91 100644 (file)
@@ -396,7 +396,7 @@ static void test_timer_schedule(void)
     g_assert(!aio_poll(ctx, false));
     g_assert_cmpint(data.n, ==, 0);
 
-    sleep(1);
+    g_usleep(1 * G_USEC_PER_SEC);
     g_assert_cmpint(data.n, ==, 0);
 
     g_assert(aio_poll(ctx, false));
@@ -729,7 +729,7 @@ static void test_source_timer_schedule(void)
 
     g_assert_cmpint(data.n, ==, 0);
 
-    sleep(1);
+    g_usleep(1 * G_USEC_PER_SEC);
     g_assert_cmpint(data.n, ==, 0);
 
     g_assert(g_main_context_iteration(NULL, false));
@@ -739,7 +739,7 @@ static void test_source_timer_schedule(void)
     do {
         g_assert(g_main_context_iteration(NULL, true));
     } while (qemu_clock_get_ns(data.clock_type) <= expiry);
-    sleep(1);
+    g_usleep(1 * G_USEC_PER_SEC);
     g_main_context_iteration(NULL, false);
 
     g_assert_cmpint(data.n, ==, 2);