[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/23] util: replace pipe()+cloexec with g_unix_open_pipe()
From: |
marcandre . lureau |
Subject: |
[PULL 08/23] util: replace pipe()+cloexec with g_unix_open_pipe() |
Date: |
Tue, 3 May 2022 17:00:08 +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>
---
util/compatfd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/util/compatfd.c b/util/compatfd.c
index 55b6e0b7fb27..147e39e2c62b 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -60,14 +60,11 @@ static int qemu_signalfd_compat(const sigset_t *mask)
info = g_malloc(sizeof(*info));
- if (pipe(fds) == -1) {
+ if (!g_unix_open_pipe(fds, FD_CLOEXEC, NULL)) {
g_free(info);
return -1;
}
- qemu_set_cloexec(fds[0]);
- qemu_set_cloexec(fds[1]);
-
memcpy(&info->mask, mask, sizeof(*mask));
info->fd = fds[1];
--
2.36.0.44.g0f828332d5ac
- [PULL 00/23] Misc patches, marcandre . lureau, 2022/05/03
- [PULL 16/23] chardev: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 22/23] tests: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 14/23] Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking(), marcandre . lureau, 2022/05/03
- [PULL 04/23] libqtest: split QMP part in libqmp, marcandre . lureau, 2022/05/03
- [PULL 13/23] io: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 08/23] util: replace pipe()+cloexec with g_unix_open_pipe(),
marcandre . lureau <=
- [PULL 05/23] Use g_unix_set_fd_nonblocking(), marcandre . lureau, 2022/05/03
- [PULL 02/23] Use QEMU_SANITIZE_ADDRESS, marcandre . lureau, 2022/05/03
- [PULL 12/23] virtiofsd: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 10/23] tests: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 01/23] Use QEMU_SANITIZE_THREAD, marcandre . lureau, 2022/05/03
- [PULL 07/23] Replace qemu_pipe() with g_unix_open_pipe(), marcandre . lureau, 2022/05/03
- [PULL 19/23] hw: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 06/23] block: move fcntl_setfl(), marcandre . lureau, 2022/05/03
- [PULL 09/23] qga: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 20/23] ui: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03