make poll() work on platforms that can't recv() on a non-socket
authorJoachim Schmitz <jojo@schmitz-digital.de>
Mon, 17 Sep 2012 21:24:42 +0000 (23:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2012 22:44:20 +0000 (15:44 -0700)
This way it just got added to gnulib too the other day.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/poll/poll.c

index e4b8319fb7335bfc31eb3e1e96605f077e2b568d..7d226ecb293ee3c5f9b17aa3e5e36b7c8701dbae 100644 (file)
@@ -306,6 +306,10 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
               || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
        happened |= POLLHUP;
 
+      /* some systems can't use recv() on non-socket, including HP NonStop */
+      else if (/* (r == -1) && */ socket_errno == ENOTSOCK)
+       happened |= (POLLIN | POLLRDNORM) & sought;
+
       else
        happened |= POLLERR;
     }