All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PULL 13/23] io: replace pipe() with g_unix_open_pipe(CLOEXEC)
Date: Tue,  3 May 2022 17:12:46 +0400	[thread overview]
Message-ID: <20220503131256.187238-14-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20220503131256.187238-1-marcandre.lureau@redhat.com>

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



  parent reply	other threads:[~2022-05-03 22:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 13:12 [PULL 00/23] Misc patches marcandre.lureau
2022-05-03 13:12 ` [PULL 01/23] Use QEMU_SANITIZE_THREAD marcandre.lureau
2022-05-03 13:12 ` [PULL 02/23] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
2022-05-03 13:12 ` [PULL 03/23] tests: move libqtest.h back under qtest/ marcandre.lureau
2022-05-03 13:12 ` [PULL 04/23] libqtest: split QMP part in libqmp marcandre.lureau
2022-05-03 13:12 ` [PULL 05/23] Use g_unix_set_fd_nonblocking() marcandre.lureau
2022-05-03 13:12 ` [PULL 06/23] block: move fcntl_setfl() marcandre.lureau
2022-05-03 13:12 ` [PULL 07/23] Replace qemu_pipe() with g_unix_open_pipe() marcandre.lureau
2022-05-03 13:12 ` [PULL 08/23] util: replace pipe()+cloexec " marcandre.lureau
2022-05-03 13:12 ` [PULL 09/23] qga: replace pipe() with g_unix_open_pipe(CLOEXEC) marcandre.lureau
2022-05-03 13:12 ` [PULL 10/23] tests: " marcandre.lureau
2022-05-03 13:12 ` [PULL 11/23] os-posix: replace pipe()+cloexec " marcandre.lureau
2022-05-03 13:12 ` [PULL 12/23] virtiofsd: replace pipe() " marcandre.lureau
2022-05-03 13:12 ` marcandre.lureau [this message]
2022-05-03 13:12 ` [PULL 14/23] Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking() marcandre.lureau
2022-05-03 13:12 ` [PULL 15/23] io: make qio_channel_command_new_pid() static marcandre.lureau
2022-05-03 13:12 ` [PULL 16/23] chardev: replace qemu_set_nonblock() marcandre.lureau
2022-05-03 13:12 ` [PULL 17/23] io: replace qemu_set{_non}block() marcandre.lureau
2022-05-03 13:12 ` [PULL 18/23] qga: replace qemu_set_nonblock() marcandre.lureau
2022-05-03 13:12 ` [PULL 19/23] hw: " marcandre.lureau
2022-05-03 13:12 ` [PULL 20/23] ui: " marcandre.lureau
2022-05-03 13:12 ` [PULL 21/23] net: " marcandre.lureau
2022-05-03 13:12 ` [PULL 22/23] tests: " marcandre.lureau
2022-05-03 13:12 ` [PULL 23/23] util: rename qemu_*block() socket functions marcandre.lureau
2022-05-03 19:38 ` [PULL 00/23] Misc patches Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2022-05-03 13:00 marcandre.lureau
2022-05-03 13:00 ` [PULL 13/23] io: replace pipe() with g_unix_open_pipe(CLOEXEC) marcandre.lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220503131256.187238-14-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.