qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Stefan Weil <sw@weilnetz.de>,
	qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 4/8] block/curl: Replace usleep by g_usleep
Date: Tue,  3 Apr 2012 11:42:43 +0100	[thread overview]
Message-ID: <1333449767-16410-5-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1333449767-16410-1-git-send-email-stefanha@linux.vnet.ibm.com>

From: Stefan Weil <sw@weilnetz.de>

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 <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 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);
-- 
1.7.9.1

  parent reply	other threads:[~2012-04-03 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03 10:42 [Qemu-devel] [PULL 0/8] Trivial patches for 27 March to 3 April 2012 Stefan Hajnoczi
2012-04-03 10:42 ` [Qemu-devel] [PATCH 1/8] configure: fix mingw32 libs_qga typo Stefan Hajnoczi
2012-04-03 10:42 ` [Qemu-devel] [PATCH 2/8] w32: Undefine error constants before their redefinition Stefan Hajnoczi
2012-04-03 10:42 ` [Qemu-devel] [PATCH 3/8] qtest: Add missing GCC_FMT_ATTR Stefan Hajnoczi
2012-04-03 10:42 ` Stefan Hajnoczi [this message]
2012-04-03 10:42 ` [Qemu-devel] [PATCH 5/8] main-loop: make qemu_event_handle static Stefan Hajnoczi
2012-04-03 10:42 ` [Qemu-devel] [PATCH 6/8] configure: Link QEMU against 'liburcu-bp' Stefan Hajnoczi
2012-04-03 10:42 ` [Qemu-devel] [PATCH 7/8] configure: Link qga against UST tracing related libraries Stefan Hajnoczi
2012-04-03 10:42 ` [Qemu-devel] [PATCH 8/8] make: fix clean rule by removing build file in qom/ Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333449767-16410-5-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).