diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-30 13:34:04 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-30 13:34:04 +0000 |
commit | a3efca16a12044b46f0e305ddcacfe6d412afcca (patch) | |
tree | a1ae1875add81b50f677ccf9ba6289eca42ac934 | |
parent | 0d2a92e0b327bd69781dd51f34278e843d5f0b74 (diff) | |
download | ruby-a3efca16a12044b46f0e305ddcacfe6d412afcca.tar.gz |
* ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD)
for MinGW. reported by Luis Lavena. [ruby-core:40526] [Bug #5516]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ruby.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Sun Oct 30 22:32:44 2011 Tanaka Akira <akr@fsij.org> + + * ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD) + for MinGW. reported by Luis Lavena. [ruby-core:40526] [Bug #5516] + Sun Oct 30 21:12:47 2011 Tanaka Akira <akr@fsij.org> * include/ruby/intern.h (rb_cloexec_pipe): declared. @@ -1819,9 +1819,10 @@ static void fill_standard_fds(void) { int f0, f1, f2, fds[2]; - f0 = fcntl(0, F_GETFD) == -1 && errno == EBADF; - f1 = fcntl(1, F_GETFD) == -1 && errno == EBADF; - f2 = fcntl(2, F_GETFD) == -1 && errno == EBADF; + struct stat buf; + f0 = fstat(0, &buf) == -1 && errno == EBADF; + f1 = fstat(1, &buf) == -1 && errno == EBADF; + f2 = fstat(2, &buf) == -1 && errno == EBADF; if (f0) { if (pipe(fds) == 0) { close(fds[1]); |