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

ruby-changes:26648

From: kosaki <ko1@a...>
Date: Sat, 5 Jan 2013 08:24:56 +0900 (JST)
Subject: [ruby-changes:26648] kosaki:r38699 (trunk): * io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.

kosaki	2013-01-05 08:23:40 +0900 (Sat, 05 Jan 2013)

  New Revision: 38699

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

  Log:
    * io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.
    * io.c (rb_maygvl_fd_fix_cloexec): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38698)
+++ ChangeLog	(revision 38699)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan  5 08:21:41 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* io.c (rb_cloexec_fcntl_dupfd): improve #ifdef condition.
+	* io.c (rb_maygvl_fd_fix_cloexec): ditto.
+
 Sat Jan  5 07:54:59 2013  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems/commands/cleanup_command.rb:  Clean all possible gems
Index: io.c
===================================================================
--- io.c	(revision 38698)
+++ io.c	(revision 38699)
@@ -168,7 +168,7 @@ void https://github.com/ruby/ruby/blob/trunk/io.c#L168
 rb_maygvl_fd_fix_cloexec(int fd)
 {
   /* MinGW don't have F_GETFD and FD_CLOEXEC.  [ruby-core:40281] */
-#if defined(F_GETFD) && !defined(__native_client__)
+#if defined(HAVE_FCNTL) && defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC) && !defined(__native_client__)
     int flags, flags2, ret;
     flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
     if (flags == -1) {
@@ -298,7 +298,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd https://github.com/ruby/ruby/blob/trunk/io.c#L298
 {
     int ret;
 
-#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC) && !defined(__native_client__)
+#if defined(HAVE_FCNTL) && defined(F_DUPFD_CLOEXEC) && defined(F_DUPFD) && !defined(__native_client__)
     static int try_dupfd_cloexec = 1;
     if (try_dupfd_cloexec) {
         ret = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
@@ -318,7 +318,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd https://github.com/ruby/ruby/blob/trunk/io.c#L318
     else {
         ret = fcntl(fd, F_DUPFD, minfd);
     }
-#elif defined(HAVE_FCNTL) && !defined(__native_client__)
+#elif defined(HAVE_FCNTL) && defined(F_DUPFD) && !defined(__native_client__)
     ret = fcntl(fd, F_DUPFD, minfd);
 #else
     ret = dup2(fd, minfd);

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

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