qga: replace pipe() with g_unix_open_pipe(CLOEXEC)
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 22 Apr 2022 10:46:36 +0000 (14:46 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 3 May 2022 11:18:41 +0000 (15:18 +0400)
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>
qga/commands-posix.c

index 77f4672ca2c91d8d12a9afd9eef90f2bc4ad1bb9..094487c2c395cbe45c8d842c7c469b73f31486d9 100644 (file)
@@ -2529,7 +2529,7 @@ void qmp_guest_set_user_password(const char *username,
         goto out;
     }
 
-    if (pipe(datafd) < 0) {
+    if (!g_unix_open_pipe(datafd, FD_CLOEXEC, NULL)) {
         error_setg(errp, "cannot create pipe FDs");
         goto out;
     }