summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 33350ea..eccd429 100644
--- a/io.c
+++ b/io.c
@@ -201,7 +201,7 @@ rb_update_max_fd(int fd)
rb_atomic_t max_fd = max_file_descriptor;
int err;
- if (afd <= max_fd)
+ if (fd < 0 || afd <= max_fd)
return;
#if defined(HAVE_FCNTL) && defined(F_GETFL)