summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-05 10:13:00 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-05 10:13:00 +0000
commit333c847f19a0e9d53ab3021fed7517a5604d2bf4 (patch)
tree688f3545d5ac1a02ffbf714b51e482a2b22db428 /io.c
parenta3521e0261d229f8402cc84a018d2bc1a64fcc5a (diff)
* io.c (rb_cloexec_fcntl_dupfd): don't clear try_dupfd_cloexec if
fcntl(F_DUPFD) failed as fcntl(F_DUPFD_CLOEXEC). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io.c b/io.c
index 7a0bf4935c..8dabdbcc9a 100644
--- a/io.c
+++ b/io.c
@@ -297,8 +297,10 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
}
/* F_DUPFD_CLOEXEC is available since Linux 2.6.24. Linux 2.6.18 fails with EINVAL */
if (errno == EINVAL) {
- try_dupfd_cloexec = 0;
ret = fcntl(fd, F_DUPFD, minfd);
+ if (ret != -1) {
+ try_dupfd_cloexec = 0;
+ }
}
}
else {