diff options
author | Marc-André Lureau | 2022-04-22 12:51:47 +0200 |
---|---|---|
committer | Marc-André Lureau | 2022-05-03 13:47:25 +0200 |
commit | d640b59eb3c7925568c5b101f439b0c0e65ea313 (patch) | |
tree | 9c999ba3ba720e08c6fa8f63347ad7c8e70f7c82 /io | |
parent | virtiofsd: replace pipe() with g_unix_open_pipe(CLOEXEC) (diff) | |
download | qemu-d640b59eb3c7925568c5b101f439b0c0e65ea313.tar.gz qemu-d640b59eb3c7925568c5b101f439b0c0e65ea313.tar.xz qemu-d640b59eb3c7925568c5b101f439b0c0e65ea313.zip |
io: replace pipe() with g_unix_open_pipe(CLOEXEC)
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>
Diffstat (limited to 'io')
-rw-r--r-- | io/channel-command.c | 4 |
1 files 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; |