From: Dr. Stephen Henson Date: Mon, 31 May 2010 13:18:08 +0000 (+0000) Subject: fix PR#2261 in a different way X-Git-Tag: OpenSSL_1_0_0a~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31c4ab5401969d44961f82c6b3f27ff695934685;p=openssl fix PR#2261 in a different way --- diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 5ea621c0cf..12b0a53a81 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -731,7 +731,14 @@ again: #ifdef SO_REUSEADDR err_num=get_last_socket_error(); if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) && +#ifdef OPENSSL_SYS_WINDOWS + /* Some versions of Windows define EADDRINUSE to + * a dummy value. + */ + (err_num == WSAEADDRINUSE)) +#else (err_num == EADDRINUSE)) +#endif { client = server; if (h == NULL || strcmp(h,"*") == 0) diff --git a/e_os.h b/e_os.h index 48ed6bdff4..5ceeeeb950 100644 --- a/e_os.h +++ b/e_os.h @@ -150,10 +150,6 @@ extern "C" { #define clear_socket_error() WSASetLastError(0) #define readsocket(s,b,n) recv((s),(b),(n),0) #define writesocket(s,b,n) send((s),(b),(n),0) -#ifdef EADDRINUSE -#undef EADDRINUSE -#endif -#define EADDRINUSE WSAEADDRINUSE #elif defined(__DJGPP__) #define WATT32 #define get_last_socket_error() errno