Browse files

block/curl: Replace usleep by g_usleep

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 <>
  • Loading branch information...
1 parent 3f97fd8 commit fb7c8e8a2d3ac99c9310a01d17a2b46584320bc9 @stweil stweil committed with Stefan Hajnoczi Mar 31, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 block/curl.c
@@ -282,7 +282,7 @@ static CURLState *curl_init_state(BDRVCURLState *s)
if (!state) {
- usleep(100);
+ g_usleep(100);
} while(!state);

0 comments on commit fb7c8e8

Please sign in to comment.