summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/socket/socket.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e4150ab76..52a5d3078 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,8 @@
-Mon Nov 28 13:20:11 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+Mon Nov 28 18:55:22 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/socket.c (init_inetsock_internal): remove setting
- SO_REUSEADDR option on server socket. fixed: [ruby-core:6765]
- ([ ruby-Bugs-2872 ])
+ SO_REUSEADDR option on server socket on Cygwin.
+ fixed: [ruby-core:6765] ([ ruby-Bugs-2872 ])
Mon Nov 28 13:11:45 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 286de4b6f..c29d4bc75 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1179,6 +1179,11 @@ init_inetsock_internal(arg)
}
arg->fd = fd;
if (type == INET_SERVER) {
+#if !defined(_WIN32) && !defined(__CYGWIN__)
+ status = 1;
+ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
+ (char*)&status, sizeof(status));
+#endif
status = bind(fd, res->ai_addr, res->ai_addrlen);
syscall = "bind(2)";
}