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

ruby-changes:21460

From: akr <ko1@a...>
Date: Sun, 23 Oct 2011 08:03:17 +0900 (JST)
Subject: [ruby-changes:21460] akr:r33509 (trunk): * io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is

akr	2011-10-23 08:03:02 +0900 (Sun, 23 Oct 2011)

  New Revision: 33509

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

  Log:
    * io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is
      defined.  reported by Luis Lavena.  [ruby-core:40281] [Bug #5470]

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33508)
+++ ChangeLog	(revision 33509)
@@ -1,3 +1,8 @@
+Sun Oct 23 08:01:29 2011  Tanaka Akira  <akr@f...>
+
+	* io.c (rb_fd_set_cloexec): set close-on-exec flag only if F_GETFD is
+	  defined.  reported by Luis Lavena.  [ruby-core:40281] [Bug #5470]
+
 Sat Oct 22 19:48:50 2011  Tanaka Akira  <akr@f...>
 
 	* test/openssl/test_ssl.rb (test_multibyte_read_write): start server
Index: io.c
===================================================================
--- io.c	(revision 33508)
+++ io.c	(revision 33509)
@@ -159,6 +159,8 @@
 
 void rb_fd_set_cloexec(int fd)
 {
+  /* MinGW don't have F_GETFD and FD_CLOEXEC.  [ruby-core:40281] */
+#ifdef F_GETFD
     int flags, ret;
     flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
     if (flags == -1) {
@@ -173,6 +175,7 @@
             }
         }
     }
+#endif
     if (max_file_descriptor < fd) max_file_descriptor = fd;
 }
 

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

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