From: Christian Grothoff Date: Thu, 6 Oct 2011 08:47:42 +0000 (+0000) Subject: LRN: Fix select() on pipes to trigger read callback on EPIPE X-Git-Tag: initial-import-from-subversion-38251~16755 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7a741efb9be24b69bf7f44279274836cdba5601c;p=oweals%2Fgnunet.git LRN: Fix select() on pipes to trigger read callback on EPIPE --- 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,