From 22106bf2fa574ba947eceb3b9cfa401c67c6a7eb Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Jul 2023 12:32:02 +1000 Subject: [PATCH] extmod/vfs_posix_file: Add poll support for missing ERR,HUP,NVAL values. Signed-off-by: Damien George --- extmod/vfs_posix_file.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index cfc56df99f..41d7622b37 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -209,6 +209,15 @@ STATIC mp_uint_t vfs_posix_file_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_ 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; #endif