From d640b59eb3c7925568c5b101f439b0c0e65ea313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 22 Apr 2022 14:51:47 +0400 Subject: [PATCH] io: replace pipe() with g_unix_open_pipe(CLOEXEC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested-by: Daniel P. Berrangé Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- 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 338da73ade..539685ea83 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;