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

ruby-changes:21538

From: naruse <ko1@a...>
Date: Mon, 31 Oct 2011 22:21:23 +0900 (JST)
Subject: [ruby-changes:21538] naruse:r33587 (trunk): * io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),

naruse	2011-10-31 22:21:03 +0900 (Mon, 31 Oct 2011)

  New Revision: 33587

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

  Log:
    * io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
      but its return value is -1 or larger than 0.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33586)
+++ ChangeLog	(revision 33587)
@@ -1,3 +1,8 @@
+Mon Oct 31 21:47:44 2011  NARUSE, Yui  <naruse@r...>
+
+	* io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),
+	  but its return value is -1 or larger than 0.
+
 Mon Oct 31 22:04:54 2011  Tanaka Akira  <akr@f...>
 
 	* ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.
Index: io.c
===================================================================
--- io.c	(revision 33586)
+++ io.c	(revision 33587)
@@ -253,8 +253,14 @@
     static int try_pipe2 = 1;
     if (try_pipe2) {
         ret = pipe2(fildes, O_CLOEXEC);
+#ifdef defined(__NetBSD__)
+        /* pipe2 is available since NetBSD 6.0. */
+	if (ret > 0)
+	    return 0;
+#else
         if (ret != -1)
             return ret;
+#endif
         /* pipe2 is available since Linux 2.6.27. */
         if (errno == ENOSYS) {
             try_pipe2 = 0;

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

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