From 60a989a76e36002e0e5c6817beab53abcfce484e Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 31 May 2010 13:17:52 +0000 Subject: [PATCH] fix PR#2261 in a different way --- crypto/bio/b_sock.c | 7 +++++++ e_os.h | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index ead477d8a2..f0d9cfca67 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -659,7 +659,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 { memcpy((char *)&client,(char *)&server,sizeof(server)); if (strcmp(h,"*") == 0) diff --git a/e_os.h b/e_os.h index 4b96c7bc6b..cc90f5e8ca 100644 --- a/e_os.h +++ b/e_os.h @@ -153,10 +153,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 -- 2.25.1