Skip to content

Commit

Permalink
make poll() work on platforms that can't recv() on a non-socket
Browse files Browse the repository at this point in the history
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
Joachim Schmitz authored and Junio C Hamano committed Sep 17, 2012
1 parent 32fde65 commit a677294
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compat/poll/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a677294

Please sign in to comment.