summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 794f6de60b..a6f323e816 100644
--- a/io.c
+++ b/io.c
@@ -155,7 +155,7 @@ void
rb_update_max_fd(int fd)
{
struct stat buf;
- if (fstat(fd, &buf) != 0) {
+ if (fstat(fd, &buf) != 0 && errno == EBADF) {
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
}
if (max_file_descriptor < fd) max_file_descriptor = fd;