From patchwork Tue Apr 3 10:42:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 150435 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6CD1FB6FE1 for ; Tue, 3 Apr 2012 22:56:46 +1000 (EST) Received: from localhost ([::1]:40771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1DP-0008CC-8e for incoming@patchwork.ozlabs.org; Tue, 03 Apr 2012 06:43:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1Cx-00071Y-1f for qemu-devel@nongnu.org; Tue, 03 Apr 2012 06:43:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SF1Cq-0002Ev-Qh for qemu-devel@nongnu.org; Tue, 03 Apr 2012 06:43:26 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:39725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1Cq-0002EH-Hg for qemu-devel@nongnu.org; Tue, 03 Apr 2012 06:43:20 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Apr 2012 11:43:16 +0100 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Apr 2012 11:42:58 +0100 Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q33Agvh72842840 for ; Tue, 3 Apr 2012 11:42:57 +0100 Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q33AgvIN032523 for ; Tue, 3 Apr 2012 04:42:57 -0600 Received: from localhost (dyn-9-174-219-44.manchester-maybrook.uk.ibm.com [9.174.219.44]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q33Agv4d032516; Tue, 3 Apr 2012 04:42:57 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Tue, 3 Apr 2012 11:42:43 +0100 Message-Id: <1333449767-16410-5-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1333449767-16410-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1333449767-16410-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12040310-2966-0000-0000-000003B1DBB2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.109 Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 4/8] block/curl: Replace usleep by g_usleep 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 From: Stefan Weil The function usleep is not available for all supported platforms: at least some versions of MinGW don't support it. usleep was also declared obsolete by POSIX.1-2001. The function g_usleep is part of glib2.0, so it is available for all supported platforms. Using nanosleep would also be possible but needs more code. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- block/curl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/curl.c b/block/curl.c index e9102e3..a909eca 100644 --- a/block/curl.c +++ b/block/curl.c @@ -282,7 +282,7 @@ static CURLState *curl_init_state(BDRVCURLState *s) break; } if (!state) { - usleep(100); + g_usleep(100); curl_multi_do(s); } } while(!state);