ui: replace qemu_set_nonblock()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 25 Apr 2022 13:39:06 +0000 (17:39 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 3 May 2022 11:52:37 +0000 (15:52 +0400)
The call is POSIX-specific. Use the dedicated GLib API.

(this is a preliminary patch before renaming qemu_set_nonblock())

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ui/input-linux.c

index 05c0c988199a99e51dfd57967b0eb994d82276fc..e572a2e905b9897acb11cf3391f8a86a88726a8e 100644 (file)
@@ -316,7 +316,10 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
         error_setg_file_open(errp, errno, il->evdev);
         return;
     }
-    qemu_set_nonblock(il->fd);
+    if (!g_unix_set_fd_nonblocking(il->fd, true, NULL)) {
+        error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+        return;
+    }
 
     rc = ioctl(il->fd, EVIOCGVERSION, &ver);
     if (rc < 0) {