aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/io.c b/io.c
index ffb4073750..46136d7ee7 100644
--- a/io.c
+++ b/io.c
@@ -4452,8 +4452,13 @@ rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds)
fcntl(fd, F_SETFD, ret|FD_CLOEXEC);
}
#else
- close(fd);
+ ret = close(fd);
#endif
+#define CONTIGUOUS_CLOSED_FDS 20
+ if (ret != -1) {
+ if (max < fd + CONTIGUOUS_CLOSED_FDS)
+ max = fd + CONTIGUOUS_CLOSED_FDS;
+ }
}
}