From: Marc-André Lureau Date: Fri, 22 Apr 2022 10:47:59 +0000 (+0400) Subject: os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC) X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3338a41f24de3033ceb9ac047811826e64b360e6;p=qemu.git os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC) Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson --- diff --git a/os-posix.c b/os-posix.c index 1b746dba97..321fc4bd13 100644 --- a/os-posix.c +++ b/os-posix.c @@ -215,7 +215,7 @@ void os_daemonize(void) pid_t pid; int fds[2]; - if (pipe(fds) == -1) { + if (!g_unix_open_pipe(fds, FD_CLOEXEC, NULL)) { exit(1); } @@ -240,7 +240,6 @@ void os_daemonize(void) close(fds[0]); daemon_pipe = fds[1]; - qemu_set_cloexec(daemon_pipe); setsid();