This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Cygwin: Use SO_EXCLUSIVEADDRUSE


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9dc34cea28d55c91a5b751530daf39a697cd1794

commit 9dc34cea28d55c91a5b751530daf39a697cd1794
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Feb 5 19:22:47 2018 +0100

    Cygwin: Use SO_EXCLUSIVEADDRUSE
    
    We're still using ~SO_REUSEADDR because SO_EXCLUSIVEADDRUSE wasn't
    defined in Mingw.  But it is in Mingw-w64, so fix it.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_socket.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index cc75b97..6eac689 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -1154,7 +1154,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
 	     for a more detailed description. */
 	  int on = 1;
 	  int ret = ::setsockopt (get_socket (), SOL_SOCKET,
-				  ~(SO_REUSEADDR),
+				  SO_EXCLUSIVEADDRUSE,
 				  (const char *) &on, sizeof on);
 	  debug_printf ("%d = setsockopt(SO_EXCLUSIVEADDRUSE), %E", ret);
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]