From: Marc-André Lureau <[email protected]>
Suggested-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
os-posix.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/os-posix.c b/os-posix.c
index faf6e6978b9f..52526c2e3f76 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -223,7 +223,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);
}
@@ -248,7 +248,6 @@ void os_daemonize(void)
close(fds[0]);
daemon_pipe = fds[1];
- qemu_set_cloexec(daemon_pipe);
setsid();
--
2.36.0