qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 13/23] io: replace pipe() with g_unix_open_pipe(CLOEXEC)


From: marcandre . lureau
Subject: [PULL 13/23] io: replace pipe() with g_unix_open_pipe(CLOEXEC)
Date: Tue, 3 May 2022 17:12:46 +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: Daniel P. Berrangé <berrange@redhat.com>
---
 io/channel-command.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/io/channel-command.c b/io/channel-command.c
index 338da73ade56..539685ea8340 100644
--- a/io/channel-command.c
+++ b/io/channel-command.c
@@ -76,8 +76,8 @@ qio_channel_command_new_spawn(const char *const argv[],
         }
     }
 
-    if ((!stdinnull && pipe(stdinfd) < 0) ||
-        (!stdoutnull && pipe(stdoutfd) < 0)) {
+    if ((!stdinnull && !g_unix_open_pipe(stdinfd, FD_CLOEXEC, NULL)) ||
+        (!stdoutnull && !g_unix_open_pipe(stdoutfd, FD_CLOEXEC, NULL))) {
         error_setg_errno(errp, errno,
                          "Unable to open pipe");
         goto error;
-- 
2.36.0.44.g0f828332d5ac




reply via email to

[Prev in Thread] Current Thread [Next in Thread]