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

ruby-changes:21529

From: usa <ko1@a...>
Date: Mon, 31 Oct 2011 10:52:31 +0900 (JST)
Subject: [ruby-changes:21529] usa:r33578 (trunk): * io.c (rb_cloexec_fcntl_dupfd): this function needs F_DUPFD.

usa	2011-10-31 10:52:21 +0900 (Mon, 31 Oct 2011)

  New Revision: 33578

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

  Log:
    * io.c (rb_cloexec_fcntl_dupfd): this function needs F_DUPFD.
    
    * io.c (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd() only if the
      platform has F_DUPFD.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33577)
+++ ChangeLog	(revision 33578)
@@ -1,3 +1,10 @@
+Mon Oct 31 10:50:26 2011  NAKAMURA Usaku  <usa@r...>
+
+	* io.c (rb_cloexec_fcntl_dupfd): this function needs F_DUPFD.
+
+	* io.c (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd() only if the
+	  platform has F_DUPFD.
+
 Mon Oct 31 00:50:00 2011  Luis Lavena  <luislavena@g...>
 
 	* configure.in: check -fno-omit-frame-pointer acceptance and usage
Index: io.c
===================================================================
--- io.c	(revision 33577)
+++ io.c	(revision 33578)
@@ -302,11 +302,15 @@
 int
 rb_cloexec_fcntl_dupfd(int fd, int minfd)
 {
+#if defined(F_DUPFD)
     int ret;
     ret = fcntl(fd, F_DUPFD, minfd);
     if (ret == -1) return -1;
     fd_set_cloexec(ret);
     return ret;
+#else
+    return -1;
+#endif
 }
 
 #define argf_of(obj) (*(struct argf *)DATA_PTR(obj))
@@ -7831,9 +7835,11 @@
     if (arg->io_p)
 	return (VALUE)ioctl(arg->fd, arg->cmd, arg->narg);
     else
+#if defined(F_DUPFD)
         if (arg->cmd == F_DUPFD)
             return (VALUE)rb_cloexec_fcntl_dupfd(arg->fd, arg->narg);
         else
+#endif
             return (VALUE)fcntl(arg->fd, arg->cmd, arg->narg);
 }
 

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

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