From 356676bc5e7f232935c3aa8460eb2fa0b664d76d Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 28 Oct 2022 10:12:58 -0400 Subject: [PATCH] glib-unix: Ensure failure in recursive g_unix_open_pipe is propagated g_unix_open_pipe sometimes recursively calls itself (to avoid getting fds assigned in the standard io fd range). Unfortunately, it fails to propagate its result to the outer most caller. This commit fixes that. --- glib/glib-unix.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/glib/glib-unix.c b/glib/glib-unix.c index 4710c5116..905ecee04 100644 --- a/glib/glib-unix.c +++ b/glib/glib-unix.c @@ -116,8 +116,7 @@ g_unix_open_pipe (int *fds, close (old_fds[0]); close (old_fds[1]); - if (!result) - g_unix_set_error_from_errno (error, errno); + return result; } else if (ecode == 0) return TRUE; @@ -135,9 +134,6 @@ g_unix_open_pipe (int *fds, close (old_fds[0]); close (old_fds[1]); - if (!result) - g_unix_set_error_from_errno (error, errno); - return result; }