mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
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.
This commit is contained in:
parent
14b5207bfa
commit
05d2a1d097
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user