threads / patch / 31470

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

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

## tl;dr

One message between Sep 7, 2012 and Sep 7, 2012. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Joachim Schmitz· Sep 7, 2012, 12:57 UTC · lore

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 <jojo@schmitz-digital.de>
---
 compat/poll/poll.c | 5 +++++
 1 file changed, 5 insertions(+)
Show changes to compat/poll/poll.c +5 −0
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

← back to recent threads