From 7a741efb9be24b69bf7f44279274836cdba5601c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 6 Oct 2011 08:47:42 +0000 Subject: LRN: Fix select() on pipes to trigger read callback on EPIPE --- src/util/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/network.c b/src/util/network.c index 320304fe2..3be21599e 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -1531,7 +1531,12 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, "Peek at read pipe %d (0x%x) returned %d (%d bytes available) GLE %u\n", i, readArray[i]->h, bret, waitstatus, error); #endif - if (bret == 0 || waitstatus <= 0) + if (bret == 0) + { + if (error != ERROR_BROKEN_PIPE) + continue; + } + else if (waitstatus <= 0) continue; GNUNET_CONTAINER_slist_add (handles_read, GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT, -- cgit v1.2.3