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

ruby-changes:9807

From: akr <ko1@a...>
Date: Tue, 6 Jan 2009 00:35:42 +0900 (JST)
Subject: [ruby-changes:9807] Ruby:r21347 (trunk): * io.c (rb_close_before_exec): more heuristics to detect maximum fd.

akr	2009-01-06 00:35:21 +0900 (Tue, 06 Jan 2009)

  New Revision: 21347

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

  Log:
    * io.c (rb_close_before_exec): more heuristics to detect maximum fd.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 21346)
+++ ChangeLog	(revision 21347)
@@ -1,3 +1,7 @@
+Tue Jan  6 00:34:25 2009  Tanaka Akira  <akr@f...>
+
+	* io.c (rb_close_before_exec): more heuristics to detect maximum fd.
+
 Mon Jan  5 17:59:43 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (cygwin): needs properly implemented nl_langinfo().
Index: io.c
===================================================================
--- io.c	(revision 21346)
+++ io.c	(revision 21347)
@@ -4452,8 +4452,13 @@
             fcntl(fd, F_SETFD, ret|FD_CLOEXEC);
         }
 #else
-	close(fd);
+	ret = close(fd);
 #endif
+#define CONTIGUOUS_CLOSED_FDS 20
+        if (ret != -1) {
+	    if (max < fd + CONTIGUOUS_CLOSED_FDS)
+		max = fd + CONTIGUOUS_CLOSED_FDS;
+	}
     }
 }
 

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

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