[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/23] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOE
From: |
marcandre . lureau |
Subject: |
[PULL 11/23] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC) |
Date: |
Tue, 3 May 2022 17:12:44 +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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
os-posix.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/os-posix.c b/os-posix.c
index 1b746dba97a7..321fc4bd13b8 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();
--
2.36.0.44.g0f828332d5ac
- [PULL 17/23] io: replace qemu_set{_non}block(), (continued)
- [PULL 17/23] io: replace qemu_set{_non}block(), marcandre . lureau, 2022/05/03
- [PULL 23/23] util: rename qemu_*block() socket functions, marcandre . lureau, 2022/05/03
- [PULL 21/23] net: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 18/23] qga: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 15/23] io: make qio_channel_command_new_pid() static, marcandre . lureau, 2022/05/03
- [PULL 11/23] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 00/23] Misc patches, marcandre . lureau, 2022/05/03
- [PULL 19/23] hw: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 09/23] qga: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- Re: [PULL 00/23] Misc patches, Richard Henderson, 2022/05/03
- [PULL 11/23] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC),
marcandre . lureau <=
- [PULL 03/23] tests: move libqtest.h back under qtest/, marcandre . lureau, 2022/05/03
- [PULL 01/23] Use QEMU_SANITIZE_THREAD, marcandre . lureau, 2022/05/03
- [PULL 15/23] io: make qio_channel_command_new_pid() static, marcandre . lureau, 2022/05/03
- [PULL 10/23] tests: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 18/23] qga: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 16/23] chardev: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 07/23] Replace qemu_pipe() with g_unix_open_pipe(), marcandre . lureau, 2022/05/03
- [PULL 02/23] Use QEMU_SANITIZE_ADDRESS, marcandre . lureau, 2022/05/03
- [PULL 14/23] Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking(), marcandre . lureau, 2022/05/03
- [PULL 06/23] block: move fcntl_setfl(), marcandre . lureau, 2022/05/03