summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 45f0fa7355..48115d8ddc 100644
--- a/thread.c
+++ b/thread.c
@@ -3694,6 +3694,7 @@ rb_wait_for_single_fd(int fd, int events, struct timeval *tv)
RUBY_VM_CHECK_INTS_BLOCKING(th);
} while (result < 0 && retryable(errno = lerrno) && poll_update());
+ if (result < 0) return -1;
if (fds.revents & POLLNVAL) {
errno = EBADF;