Skip to contentSkip to conversation

qga: replace usleep() with g_usleep()

PATCH In review [email protected] 2 participants 2 messages Mar 31, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qga: replace usleep() with g_usleep()

From: Marc-André Lureau <[email protected]>

The latter simply requires glib.h, while the former is not in the Windows API (but provided by mingw header & CRT)

Also simplify the expression for 1/10s.

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +1 -1
index 1deb0ee2fbfe..6a5be23225d0 100644
@@ -610,7 +610,7 @@ static gboolean channel_event_cb(GIOCondition condition, gpointer data)
          * host-side chardev. sleep a bit to mitigate this
          */
         if (s->virtio) {
-            usleep(100 * 1000);
+            g_usleep(G_USEC_PER_SEC / 10);
         }
         return true;
     default:
Signature · 1 line
2.35.1.693.g805e0a68082a
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · On 31/3/22 22:53, [email protected] wrote:

From: Marc-André Lureau <[email protected]>

The latter simply requires glib.h, while the former is not in the Windows API (but provided by mingw header & CRT)

Also simplify the expression for 1/10s.

---
  qga/main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)