From 3be312869dd62faecc679d2989ff62212ee6f234 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 28 Nov 2005 09:56:45 +0000 Subject: [PATCH] * ext/socket/socket.c (init_inetsock_internal): remove setting SO_REUSEADDR option on server socket on Cygwin. fixed: [ruby-core:6765] ([ ruby-Bugs-2872 ]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 +++--- ext/socket/socket.c | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4150ab761..52a5d30788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ -Mon Nov 28 13:20:11 2005 NAKAMURA Usaku +Mon Nov 28 18:55:22 2005 NAKAMURA Usaku * 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 diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 286de4b6f7..c29d4bc759 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)"; }