summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-11 14:55:35 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-11 14:55:35 +0000
commit8d087aa871d26f1ef22e7e9c98211d207f51360c (patch)
tree334693469139df16d72667eb70f4a6a22bcae5d7
parent1ebb3a2b50126fba8a54ebbf2694645894d933ec (diff)
merge revision(s) 40136: [Backport #9084]
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@43649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/socket/init.c6
-rw-r--r--version.h2
3 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 804c3e4b09..52e19bbd36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Nov 11 23:54:51 2013 Tanaka Akira <akr@fsij.org>
+
+ * 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.
+
Mon Nov 11 22:14:37 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/win32.h (rb_infinity_float): suppress overflow in
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 4c1d17df98..9999c02969 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -488,7 +488,11 @@ cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len)
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)
diff --git a/version.h b/version.h
index 9cb5beff44..cfc84cdf5b 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-11-11"
-#define RUBY_PATCHLEVEL 344
+#define RUBY_PATCHLEVEL 345
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 11