[前][次][番号順一覧][スレッド一覧]

ruby-changes:21524

From: akr <ko1@a...>
Date: Sun, 30 Oct 2011 22:34:15 +0900 (JST)
Subject: [ruby-changes:21524] akr:r33573 (trunk): * ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD)

akr	2011-10-30 22:34:04 +0900 (Sun, 30 Oct 2011)

  New Revision: 33573

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33573

  Log:
    * ruby.c (fill_standard_fds): use fstat() instead of fcntl(F_GETFD)
      for MinGW.  reported by Luis Lavena.  [ruby-core:40526] [Bug #5516]

  Modified files:
    trunk/ChangeLog
    trunk/ruby.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33572)
+++ ChangeLog	(revision 33573)
@@ -1,3 +1,8 @@
+Sun Oct 30 22:32:44 2011  Tanaka Akira  <akr@f...>
+
+	* 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@f...>
 
 	* include/ruby/intern.h (rb_cloexec_pipe): declared.
Index: ruby.c
===================================================================
--- ruby.c	(revision 33572)
+++ ruby.c	(revision 33573)
@@ -1819,9 +1819,10 @@
 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]);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]