diff options
author | Maciej S. Szmigiero <maciej.szmigiero@oracle.com> | 2023-02-19 14:44:28 +0100 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2023-02-21 12:42:55 +0000 |
commit | 05d2a1d09757feb1aea2926ce7f205a4aa1e2d7f (patch) | |
tree | a98278e4644c2dc260a6681d83982b36643cf98e /glib/gbacktrace.c | |
parent | 14b5207bfa40ab6419abc145680dcfbf190c78bb (diff) | |
download | glib-05d2a1d09757feb1aea2926ce7f205a4aa1e2d7f.tar.gz |
gbacktrace: Use g_unix_open_pipe_internal () for creating pipes
This attempts to create the pipes with race-free setting of the
close-on-exec flag.
Diffstat (limited to 'glib/gbacktrace.c')
-rw-r--r-- | glib/gbacktrace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index 9c52a7d29..b708b1636 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -45,6 +45,7 @@ #include <time.h> #ifdef G_OS_UNIX +#include "glib-unixprivate.h" #include <errno.h> #include <unistd.h> #include <sys/wait.h> @@ -397,7 +398,8 @@ stack_trace (const char * const *args) stack_trace_done = FALSE; signal (SIGCHLD, stack_trace_sigchld); - if ((pipe (in_fd) == -1) || (pipe (out_fd) == -1)) + if (!g_unix_open_pipe_internal (in_fd, TRUE) || + !g_unix_open_pipe_internal (out_fd, TRUE)) { perror ("unable to open pipe"); _exit (0); |