From eadfa019b3c82d07fb173eb34f09604c82e99a1f Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 31 May 2010 13:18:21 +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 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 -- 2.25.1