From 91edec25dd2a50e44b970296e55e1570c3e0d33c Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Mon, 4 Sep 2017 10:39:58 +0300 Subject: [PATCH] examples: ipcpipeline: get rid of yet another use of SOCK_NONBLOCK https://bugzilla.gnome.org/show_bug.cgi?id=786763 --- tests/examples/ipcpipeline/ipc-play.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/examples/ipcpipeline/ipc-play.c b/tests/examples/ipcpipeline/ipc-play.c index 805bbcca81..8c817a2c9f 100644 --- a/tests/examples/ipcpipeline/ipc-play.c +++ b/tests/examples/ipcpipeline/ipc-play.c @@ -969,10 +969,16 @@ main (gint argc, gchar ** argv) return 1; } - if (socketpair (AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, pipes)) { + if (socketpair (AF_UNIX, SOCK_STREAM, 0, pipes)) { fprintf (stderr, "Error creating pipes: %s\n", strerror (errno)); return 2; } + if (fcntl (pipes[0], F_SETFL, O_NONBLOCK) < 0 || + fcntl (pipes[1], F_SETFL, O_NONBLOCK) < 0) { + fprintf (stderr, "Error setting O_NONBLOCK on pipes: %s\n", + strerror (errno)); + return 2; + } pid = fork (); if (pid < 0) {