Browse Source

ui: replace qemu_set_nonblock()

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>
Marc-André Lureau 3 years ago
parent
commit
c7b1172026
1 changed files with 4 additions and 1 deletions
  1. 4 1
      ui/input-linux.c

+ 4 - 1
ui/input-linux.c

@@ -316,7 +316,10 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
         error_setg_file_open(errp, errno, il->evdev);
         error_setg_file_open(errp, errno, il->evdev);
         return;
         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);
     rc = ioctl(il->fd, EVIOCGVERSION, &ver);
     if (rc < 0) {
     if (rc < 0) {