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

1 messages from 2012-09-07 to 2012-09-07. Participants: Joachim Schmitz.
Thread: https://gitlist.dev/t/31470

## Joachim Schmitz, 2012-09-07 12:57

Subject: RE: [PATCH v3 4/4] make poll() work on platforms that can't recv() on a non-socket
Message-ID: <003d01cd8cf8$4f931630$eeb94290$@schmitz-digital.de>
URL: https://gitlist.dev/e/003d01cd8cf8%244f931630%24eeb94290%24%40schmitz-digital.de

```
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(+)

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

```
