mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
gtestdbus: 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
05d2a1d097
commit
dd36ee0abf
@ -50,6 +50,7 @@
|
|||||||
|
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
#include "glib-unix.h"
|
#include "glib-unix.h"
|
||||||
|
#include "glib-unixprivate.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@ -248,7 +249,7 @@ watcher_init (void)
|
|||||||
gint pipe_fds[2];
|
gint pipe_fds[2];
|
||||||
|
|
||||||
/* fork a child to clean up when we are killed */
|
/* fork a child to clean up when we are killed */
|
||||||
if (pipe (pipe_fds) != 0)
|
if (!g_unix_open_pipe_internal (pipe_fds, TRUE))
|
||||||
{
|
{
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
g_warning ("pipe() failed: %s", g_strerror (errsv));
|
g_warning ("pipe() failed: %s", g_strerror (errsv));
|
||||||
|
Loading…
Reference in New Issue
Block a user