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

ruby-changes:28084

From: akr <ko1@a...>
Date: Sat, 6 Apr 2013 01:40:48 +0900 (JST)
Subject: [ruby-changes:28084] akr:r40136 (trunk): * ext/socket/init.c (cloexec_accept): Fix a compile error on

akr	2013-04-06 01:40:36 +0900 (Sat, 06 Apr 2013)

  New Revision: 40136

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

  Log:
    * ext/socket/init.c (cloexec_accept): Fix a compile error on
      Debian GNU/kFreeBSD.  Consider HAVE_ACCEPT4 is defined
      but SOCK_CLOEXEC is not defined.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/init.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40135)
+++ ChangeLog	(revision 40136)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Apr  6 01:21:56 2013  Tanaka Akira  <akr@f...>
+
+	* ext/socket/init.c (cloexec_accept): Fix a compile error on
+	  Debian GNU/kFreeBSD.  Consider HAVE_ACCEPT4 is defined
+	  but SOCK_CLOEXEC is not defined.
+
 Sat Apr  6 00:19:30 2013  Hiroshi Shirosaki  <h.shirosaki@g...>
 
 	* load.c (features_index_add): use rb_str_subseq() to specify C string
Index: ext/socket/init.c
===================================================================
--- ext/socket/init.c	(revision 40135)
+++ ext/socket/init.c	(revision 40136)
@@ -497,7 +497,11 @@ cloexec_accept(int socket, struct sockad https://github.com/ruby/ruby/blob/trunk/ext/socket/init.c#L497
     if (address_len) len0 = *address_len;
 #ifdef HAVE_ACCEPT4
     if (try_accept4) {
-        ret = accept4(socket, address, address_len, SOCK_CLOEXEC);
+        int flags = 0;
+#ifdef SOCK_CLOEXEC
+        flags |= SOCK_CLOEXEC;
+#endif
+        ret = accept4(socket, address, address_len, flags);
         /* accept4 is available since Linux 2.6.28, glibc 2.10. */
         if (ret != -1) {
             if (ret <= 2)

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

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