RE: [PATCH v3 4/4] make poll() work on platforms that can't recv() on a non-socket

From: Joachim Schmitz <hidden>
Date: 2016-06-15 22:54:39
Subsystem: the rest · Maintainer: Linus Torvalds

HP NonStop can't recv() on a non-socket, this commit cates for this.
So far for HP NonStop only, via #ifdef __TANDEM, but it may be usefull
for others too. A similar patch got sent to gnulib.

Signed-off-by: Joachim Schmitz <redacted>
---
 compat/poll/poll.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index e4b8319..10a204e 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -306,6 +306,11 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
 	       || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
 	happened |= POLLHUP;
 
+#ifdef __TANDEM /* can't use recv() on non-socket */
+      else if (/* (r == -1) && */ socket_errno == ENOTSOCK)
+	happened |= (POLLIN | POLLRDNORM) & sought;
+#endif
+
       else
 	happened |= POLLERR;
     }
-- 
1.7.12
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help