summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-29 23:30:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-29 23:30:34 +0000
commite745a03cfa60074b6d9569491f5932a74ee20e1b (patch)
treecba8dc6c013c454a25999693846d0d9a6a6536f8 /io.c
parent503e5c975011ef9ad6f30431920c91e1e9f384e0 (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 5bec3622f4..1e04a1d6f5 100644
--- a/io.c
+++ b/io.c
@@ -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) {