[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/26] os-posix: replace pipe()+cloexec with g_unix_open_pipe(
From: |
marcandre . lureau |
Subject: |
[PATCH v2 14/26] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC) |
Date: |
Tue, 26 Apr 2022 13:27:03 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
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
- [PATCH v2 09/26] block: move fcntl_setfl(), (continued)
- [PATCH v2 09/26] block: move fcntl_setfl(), marcandre . lureau, 2022/04/26
- [PATCH v2 11/26] util: replace pipe()+cloexec with g_unix_open_pipe(), marcandre . lureau, 2022/04/26
- [PATCH v2 10/26] Replace qemu_pipe() with g_unix_open_pipe(), marcandre . lureau, 2022/04/26
- [PATCH v2 13/26] tests: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/04/26
- [PATCH v2 12/26] qga: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/04/26
- [PATCH v2 14/26] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC),
marcandre . lureau <=
- [PATCH v2 17/26] Replace fcntl(0_NONBLOCK) with g_unix_set_fd_nonblocking(), marcandre . lureau, 2022/04/26
- [PATCH v2 16/26] io: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/04/26
- [PATCH v2 15/26] virtiofsd: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/04/26
- [PATCH v2 19/26] chardev: replace qemu_set_nonblock(), marcandre . lureau, 2022/04/26
- [PATCH v2 18/26] io: make qio_channel_command_new_pid() static, marcandre . lureau, 2022/04/26
- [PATCH v2 20/26] io: replace qemu_set{_non}block(), marcandre . lureau, 2022/04/26