* 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
This commit is contained in:
akr 2011-10-29 23:30:34 +00:00
parent 503e5c9750
commit e745a03cfa
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun Oct 30 08:29:51 2011 Tanaka Akira <akr@fsij.org>
* io.c (rb_cloexec_dup2): don't set CLOEXEC for standard file
descriptors.
Sun Oct 30 07:47:10 2011 Tanaka Akira <akr@fsij.org>
* configure.in: check dup3.

2
io.c
View File

@ -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) {