Handle peek errors more appropriately in w32 select
authorLRN <lrn1986@gmail.com>
Fri, 13 Jul 2012 16:24:38 +0000 (16:24 +0000)
committerLRN <lrn1986@gmail.com>
Fri, 13 Jul 2012 16:24:38 +0000 (16:24 +0000)
src/util/network.c

index 6d8b2869ab61b5503df5af5f33940ce16647ac16..012b1af0bdfbb0066c9612fe85226b0a31bd4aa2 100644 (file)
@@ -1599,7 +1599,11 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
              i, readArray[i]->h, bret, waitstatus, error);
         if (bret == 0)
         {
-          if (error != ERROR_BROKEN_PIPE)
+          /* TODO: either add more errors to this condition, or eliminate it
+           * entirely (failed to peek -> pipe is in serious trouble, should
+           * be selected as readable).
+           */
+          if (error != ERROR_BROKEN_PIPE && error != ERROR_INVALID_HANDLE)
             continue;
         }
         else if (waitstatus <= 0)