summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>2023-02-19 14:45:50 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2023-02-21 12:42:55 +0000
commitdd36ee0abfef10aec44cb00972c4de6f95b14e24 (patch)
tree433f8ae7bd03c9aa072f1d49ef72141a0386a4e6
parent05d2a1d09757feb1aea2926ce7f205a4aa1e2d7f (diff)
downloadglib-dd36ee0abfef10aec44cb00972c4de6f95b14e24.tar.gz
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.
-rw-r--r--gio/gtestdbus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c
index 6aedb3eae..34cead176 100644
--- a/gio/gtestdbus.c
+++ b/gio/gtestdbus.c
@@ -50,6 +50,7 @@
#ifdef G_OS_UNIX
#include "glib-unix.h"
+#include "glib-unixprivate.h"
#endif
/* -------------------------------------------------------------------------- */
@@ -248,7 +249,7 @@ watcher_init (void)
gint pipe_fds[2];
/* 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;
g_warning ("pipe() failed: %s", g_strerror (errsv));