summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-04 01:00:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-04 01:00:49 +0000
commit1cedc5d47727e4e72ace38dbf843b4676d8d94a8 (patch)
treed8aadd52008d8bd4c927990893260b607f7d095d
parent917948a4c4700520d1cd9d46a403af461b562725 (diff)
downloadruby-1cedc5d47727e4e72ace38dbf843b4676d8d94a8.tar.gz
ruby-1cedc5d47727e4e72ace38dbf843b4676d8d94a8.tar.xz
ruby-1cedc5d47727e4e72ace38dbf843b4676d8d94a8.zip
* io.c (popen_exec): should not close close-on-exec FDs.
[ruby-dev:30679] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index febfc58c0..f0618e971 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Apr 4 10:01:20 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (popen_exec): should not close close-on-exec FDs.
+ [ruby-dev:30679]
+
Tue Apr 4 04:17:18 2007 Technorama Ltd. <oss-ruby@technorama.net>
* ext/openssl/ossl_ssl.c: Add documentation.
diff --git a/io.c b/io.c
index 18ad765d8..b9a84e11e 100644
--- a/io.c
+++ b/io.c
@@ -3040,6 +3040,9 @@ popen_exec(void *pp)
popen_redirect(p);
for (fd = 3; fd < NOFILE; fd++) {
+#ifdef FD_CLOEXEC
+ if (fcntl(fd, F_GETFD) & FD_CLOEXEC) continue;
+#endif
close(fd);
}
return rb_exec(&p->exec);