From 6a179019e882c181f2eec1a472f6ec4baf699a9b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Jul 2023 12:21:21 +1000 Subject: [PATCH] unix/modsocket: Add poll support for missing ERR,HUP,NVAL poll values. Signed-off-by: Damien George --- ports/unix/modsocket.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/unix/modsocket.c b/ports/unix/modsocket.c index 871be8dcf7..737550b428 100644 --- a/ports/unix/modsocket.c +++ b/ports/unix/modsocket.c @@ -164,6 +164,15 @@ STATIC mp_uint_t socket_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, i if (pfd.revents & POLLOUT) { ret |= MP_STREAM_POLL_WR; } + if (pfd.revents & POLLERR) { + ret |= MP_STREAM_POLL_ERR; + } + if (pfd.revents & POLLHUP) { + ret |= MP_STREAM_POLL_HUP; + } + if (pfd.revents & POLLNVAL) { + ret |= MP_STREAM_POLL_NVAL; + } } return ret; }