Permalink
Browse files

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>
  • Loading branch information...
1 parent 32fde65 commit a6772946a554ad97ea4f6febbff3b98fbaa2f5bf @Jojo-Schmitz Jojo-Schmitz committed with gitster Sep 17, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 compat/poll/poll.c
View
@@ -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;
}

0 comments on commit a677294

Please sign in to comment.