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 /io.c | |
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
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |