* io.c (rb_close_before_exec): more heuristics to detect maximum fd.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0cd078e358
commit
e6045986ef
@ -1,3 +1,7 @@
|
||||
Tue Jan 6 00:34:25 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* io.c (rb_close_before_exec): more heuristics to detect maximum fd.
|
||||
|
||||
Mon Jan 5 17:59:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (cygwin): needs properly implemented nl_langinfo().
|
||||
|
7
io.c
7
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user