From 9c64c3ed5c45084e62f46fc6b5d80948697c3f86 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 4 Apr 2007 01:00:49 +0000 Subject: [PATCH] * io.c (popen_exec): should not close close-on-exec FDs. [ruby-dev:30679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ io.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index febfc58c00..f0618e9712 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Apr 4 10:01:20 2007 Nobuyoshi Nakada + + * io.c (popen_exec): should not close close-on-exec FDs. + [ruby-dev:30679] + Tue Apr 4 04:17:18 2007 Technorama Ltd. * ext/openssl/ossl_ssl.c: Add documentation. diff --git a/io.c b/io.c index 18ad765d85..b9a84e11e4 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);