LRN: Fix select() on pipes to trigger read callback on EPIPE
authorChristian Grothoff <christian@grothoff.org>
Thu, 6 Oct 2011 08:47:42 +0000 (08:47 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 6 Oct 2011 08:47:42 +0000 (08:47 +0000)
src/util/network.c

index 320304fe2de19a7976ee9696ee403f7f4f83ec4e..3be21599eef8302db8c8599e5d66787a50224153 100644 (file)
@@ -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,