aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 6246243706..5e10a8366f 100644
--- a/thread.c
+++ b/thread.c
@@ -2737,7 +2737,10 @@ retry:
}, ubf_select, GET_THREAD());
if (result > 0) {
- /* remain compatible with select(2)-based implementation */
+ if (fds.revents & POLLNVAL) {
+ errno = EBADF;
+ return -1;
+ }
result = (int)(fds.revents & fds.events);
return result == 0 ? events : result;
}