diff --git a/glib/gtester.c b/glib/gtester.c index 4edcf2d29..0a2feb22e 100644 --- a/glib/gtester.c +++ b/glib/gtester.c @@ -20,6 +20,7 @@ #include "config.h" #include +#include #include #include #include @@ -285,12 +286,13 @@ launch_test_binary (const char *binary, gboolean loop_pending; gint i = 0; - if (pipe (report_pipe) < 0) + if (!g_unix_open_pipe (report_pipe, FD_CLOEXEC, &error)) { if (subtest_mode_fatal) - g_error ("Failed to open pipe for test binary: %s: %s", binary, g_strerror (errno)); + g_error ("Failed to open pipe for test binary: %s: %s", binary, error->message); else - g_warning ("Failed to open pipe for test binary: %s: %s", binary, g_strerror (errno)); + g_warning ("Failed to open pipe for test binary: %s: %s", binary, error->message); + g_clear_error (&error); return FALSE; }