X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpoll.c;h=e50c4781fc94266e25cf6fc0be050f60aae233d2;hb=25b6b5120113989e0b91de9d0b75d3d625bbc753;hp=3071b12655d6fd75b411e3951637fe70b3b50ca3;hpb=341111f654709cd0295607a4abbe721495c77e90;p=gnulib.git diff --git a/lib/poll.c b/lib/poll.c index 3071b1265..e50c4781f 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; } @@ -350,7 +354,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) /* EFAULT is not necessary to implement, but let's do it in the simplest case. */ - if (!pfd) + if (!pfd && nfd) { errno = EFAULT; return -1; @@ -598,7 +602,7 @@ restart: if (!rc && timeout == INFTIM) { - SwitchToThread(); + SleepEx (1, TRUE); goto restart; }