diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-03-29 15:21:00 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:17:56 +0400 |
commit | a7241974ceca3a783ab010f3fd1926fa42346a34 (patch) | |
tree | c34b1323dd4a96d92131dc9caf16c89c04ee5556 /qemu-nbd.c | |
parent | ad24b679d215c2f8eaab6125a68e864c2a5d7dde (diff) |
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.c | 5 |
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); } |