summaryrefslogtreecommitdiffstats
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorMarc-André Lureau2022-03-29 13:21:00 +0200
committerMarc-André Lureau2022-05-03 13:17:56 +0200
commita7241974ceca3a783ab010f3fd1926fa42346a34 (patch)
treec34b1323dd4a96d92131dc9caf16c89c04ee5556 /qemu-nbd.c
parentblock: move fcntl_setfl() (diff)
downloadqemu-a7241974ceca3a783ab010f3fd1926fa42346a34.tar.gz
qemu-a7241974ceca3a783ab010f3fd1926fa42346a34.tar.xz
qemu-a7241974ceca3a783ab010f3fd1926fa42346a34.zip
Replace qemu_pipe() with g_unix_open_pipe()
GLib g_unix_open_pipe() is essentially like qemu_pipe(), available since 2.30. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index db63980df1..2382b5042a 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -909,13 +909,14 @@ int main(int argc, char **argv)
if ((device && !verbose) || fork_process) {
#ifndef WIN32
+ g_autoptr(GError) err = NULL;
int stderr_fd[2];
pid_t pid;
int ret;
- if (qemu_pipe(stderr_fd) < 0) {
+ if (!g_unix_open_pipe(stderr_fd, FD_CLOEXEC, &err)) {
error_report("Error setting up communication pipe: %s",
- strerror(errno));
+ err->message);
exit(EXIT_FAILURE);
}