mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-19 07:08:54 +02: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:
committed by
Philip Withnall
parent
14b5207bfa
commit
05d2a1d097
@@ -45,6 +45,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
|
#include "glib-unixprivate.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -397,7 +398,8 @@ stack_trace (const char * const *args)
|
|||||||
stack_trace_done = FALSE;
|
stack_trace_done = FALSE;
|
||||||
signal (SIGCHLD, stack_trace_sigchld);
|
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");
|
perror ("unable to open pipe");
|
||||||
_exit (0);
|
_exit (0);
|
||||||
|
Reference in New Issue
Block a user