diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-03-29 15:25:05 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:17:30 +0400 |
commit | 4d14cb0cd7868d11091acf5c930982cae4e3489c (patch) | |
tree | b04526babcdc90caa67d374211e71dc0389187de /util/event_notifier-posix.c | |
parent | c6d3bcb4b91e9ebf08f3afb8759760a9dbb2b744 (diff) |
Use g_unix_set_fd_nonblocking()
API available since glib 2.30. It also preserves errno.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'util/event_notifier-posix.c')
-rw-r--r-- | util/event_notifier-posix.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c index 8dc30c5141..2aa14eabb3 100644 --- a/util/event_notifier-posix.c +++ b/util/event_notifier-posix.c @@ -52,13 +52,11 @@ int event_notifier_init(EventNotifier *e, int active) if (qemu_pipe(fds) < 0) { 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; } |