]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/event_notifier-posix.c
Merge tag 'pull-loongarch-20231221' of https://gitlab.com/gaosong/qemu into staging
[mirror_qemu.git] / util / event_notifier-posix.c
index 16294e98d434e83e39fa13fb721fba7b09a595e4..76420c5b560c15bb7a6a0c7960a2072ebe174bc1 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/cutils.h"
 #include "qemu/event_notifier.h"
 #include "qemu/main-loop.h"
@@ -50,16 +49,14 @@ int event_notifier_init(EventNotifier *e, int active)
         if (errno != ENOSYS) {
             return -errno;
         }
-        if (qemu_pipe(fds) < 0) {
+        if (!g_unix_open_pipe(fds, FD_CLOEXEC, NULL)) {
             return -errno;
         }
-        ret = fcntl_setfl(fds[0], O_NONBLOCK);
-        if (ret < 0) {
+        if (!g_unix_set_fd_nonblocking(fds[0], true, NULL)) {
             ret = -errno;
             goto fail;
         }
-        ret = fcntl_setfl(fds[1], O_NONBLOCK);
-        if (ret < 0) {
+        if (!g_unix_set_fd_nonblocking(fds[1], true, NULL)) {
             ret = -errno;
             goto fail;
         }