diff options
author | Joachim Schmitz <jojo@schmitz-digital.de> | 2012-09-13 08:55:08 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-09-13 08:57:02 +0200 |
commit | 20a4d1d3860aa7bca90e1b51501084d5c33ee4f1 (patch) | |
tree | de58962a401aa263cd4fb171af676136b6ee3008 /lib | |
parent | 48e7c1cff9531ce0fe05108ea7ec69f2d20472b5 (diff) | |
download | gnulib-20a4d1d3860aa7bca90e1b51501084d5c33ee4f1.tar.gz |
poll: fix for systems that can't recv() on a non-socket
* lib/poll.c: if recv returns ENOTSOCK, assume the descriptor
is readable. In this case POLLHUP will not be supported.
* doc/posix-functions/poll.texi: Document this.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/poll.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/poll.c b/lib/poll.c index 5ad9d866be..b696dee0d6 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -303,6 +303,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 (socket_errno == ENOTSOCK) + happened |= (POLLIN | POLLRDNORM) & sought; + else happened |= POLLERR; } |