diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-05-31 13:18:21 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-05-31 13:18:21 +0000 |
commit | eadfa019b3c82d07fb173eb34f09604c82e99a1f (patch) | |
tree | e673a4e9dd26ab36011bfcca8fe2d67f0768ee89 | |
parent | 97999375106863dd45af70a7050d99e6b29ef341 (diff) |
fix PR#2261 in a different way
-rw-r--r-- | crypto/bio/b_sock.c | 7 | ||||
-rw-r--r-- | 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) @@ -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 |