make poll() work on platforms that can't recv() on a non-socket
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>
Joachim Schmitz committed
Sep 17, 2012 at 23:24 UTC
a6772946a554ad97ea4f6febbff3b98fbaa2f5bf
1 file changed
+4
compat/poll/poll.c
+4
@@ -306,6 +306,10 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
306
|| socket_errno == ECONNABORTED || socket_errno == ENETRESET)
307
happened |= POLLHUP;
308
309
+ /* some systems can't use recv() on non-socket, including HP NonStop */
310
+ else if (/* (r == -1) && */ socket_errno == ENOTSOCK)
311
+ happened |= (POLLIN | POLLRDNORM) & sought;
312
+
313
else
314
happened |= POLLERR;
315
}