aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-22 14:45:35 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-05-03 15:18:14 +0400
commit81badab381db30930f73f7fd16348f4df2ba7252 (patch)
tree0ffb54bffe80182816e8e7a56e88080739d74a97
parenta7241974ceca3a783ab010f3fd1926fa42346a34 (diff)
downloadqemu-81badab381db30930f73f7fd16348f4df2ba7252.zip
qemu-81badab381db30930f73f7fd16348f4df2ba7252.tar.gz
qemu-81badab381db30930f73f7fd16348f4df2ba7252.tar.bz2
util: replace pipe()+cloexec with g_unix_open_pipe()
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>
-rw-r--r--util/compatfd.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/util/compatfd.c b/util/compatfd.c
index 55b6e0b..147e39e 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];