glib-unix: Add O_NONBLOCK support to g_unix_open_pipe()

Add support for it, but don’t use it anywhere yet — this is an API
addition, but currently doesn’t cause any functional changes. It’ll be
used in the next commit.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall
2023-03-23 00:55:00 +00:00
parent 56c013cb6e
commit 5c65437d73
4 changed files with 60 additions and 24 deletions

View File

@@ -249,7 +249,7 @@ watcher_init (void)
gint pipe_fds[2];
/* fork a child to clean up when we are killed */
if (!g_unix_open_pipe_internal (pipe_fds, TRUE))
if (!g_unix_open_pipe_internal (pipe_fds, TRUE, FALSE))
{
errsv = errno;
g_warning ("pipe() failed: %s", g_strerror (errsv));