From patchwork Thu Aug 29 18:19:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bligh X-Patchwork-Id: 270890 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 562692C00A9 for ; Fri, 30 Aug 2013 04:20:15 +1000 (EST) Received: from localhost ([::1]:45209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF6pI-0004um-4I for incoming@patchwork.ozlabs.org; Thu, 29 Aug 2013 14:20:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF6or-0004lk-8Y for qemu-devel@nongnu.org; Thu, 29 Aug 2013 14:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF6op-000874-WE for qemu-devel@nongnu.org; Thu, 29 Aug 2013 14:19:45 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:34497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF6op-00086d-Pq for qemu-devel@nongnu.org; Thu, 29 Aug 2013 14:19:43 -0400 Received: by mail.avalus.com (Postfix) with ESMTPSA id B8200C561AB; Thu, 29 Aug 2013 19:19:31 +0100 (BST) From: Alex Bligh To: qemu-devel@nongnu.org, Charlie Shepherd Date: Thu, 29 Aug 2013 19:19:28 +0100 Message-Id: <1377800368-12232-1-git-send-email-alex@alex.org.uk> X-Mailer: git-send-email 1.7.9.5 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:41c8:10:1dd::10 Cc: Kevin Wolf , Anthony Liguori , Alex Bligh , Jan Kiszka , liu ping fan , Gerd Hoffmann , Stefan Hajnoczi , Anthony Perard , Paolo Bonzini , MORITA Kazutaka , rth@twiddle.net Subject: [Qemu-devel] [PATCH] aio / timers: use g_usleep() not sleep() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org sleep() apparently doesn't exist under mingw. Use g_usleep for portability. Signed-off-by: Alex Bligh --- tests/test-aio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-aio.c b/tests/test-aio.c index 4215701..110fa4a 100644 --- a/tests/test-aio.c +++ b/tests/test-aio.c @@ -400,7 +400,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)); @@ -736,7 +736,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)); @@ -746,7 +746,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);