Skip to content

Commit a677294

Browse files
Jojo-Schmitzgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32fde65 commit a677294

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/poll/poll.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
306306
|| socket_errno == ECONNABORTED || socket_errno == ENETRESET)
307307
happened |= POLLHUP;
308308

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+
309313
else
310314
happened |= POLLERR;
311315
}

0 commit comments

Comments
 (0)