diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-05 15:35:21 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-05 15:35:21 +0000 |
| commit | 268a6dcd9143db2b1dfe6bbf3ba5f87193ad7f39 (patch) | |
| tree | d0946322fa7be92fb933c652b44faf2cd56aaf14 | |
| parent | 9539cba2febc8afa8178db497816e1f61dc07872 (diff) | |
| download | ruby-268a6dcd9143db2b1dfe6bbf3ba5f87193ad7f39.tar.gz ruby-268a6dcd9143db2b1dfe6bbf3ba5f87193ad7f39.tar.xz ruby-268a6dcd9143db2b1dfe6bbf3ba5f87193ad7f39.zip | |
* io.c (rb_close_before_exec): more heuristics to detect maximum fd.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | io.c | 7 |
2 files changed, 10 insertions, 1 deletions
@@ -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(). @@ -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; + } } } |
