diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-29 23:30:34 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-29 23:30:34 +0000 |
| commit | e745a03cfa60074b6d9569491f5932a74ee20e1b (patch) | |
| tree | cba8dc6c013c454a25999693846d0d9a6a6536f8 | |
| parent | 503e5c975011ef9ad6f30431920c91e1e9f384e0 (diff) | |
* io.c (rb_cloexec_dup2): don't set CLOEXEC for standard file
descriptors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | io.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sun Oct 30 08:29:51 2011 Tanaka Akira <akr@fsij.org> + + * io.c (rb_cloexec_dup2): don't set CLOEXEC for standard file + descriptors. + Sun Oct 30 07:47:10 2011 Tanaka Akira <akr@fsij.org> * configure.in: check dup3. @@ -234,7 +234,7 @@ rb_cloexec_dup2(int oldfd, int newfd) #if defined(HAVE_DUP3) && defined(O_CLOEXEC) static int try_dup3 = 1; - if (try_dup3) { + if (2 < newfd && try_dup3) { ret = dup3(oldfd, newfd, O_CLOEXEC); /* dup3 is available since Linux 2.6.27. */ if (ret == -1 && errno == ENOSYS) { |
