From 3338a41f24de3033ceb9ac047811826e64b360e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 22 Apr 2022 14:47:59 +0400 Subject: [PATCH] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson --- os-posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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();