From 316efac5a44d4de39cde394886fb6cd2e1a99706 Mon Sep 17 00:00:00 2001 From: jsing Date: Wed, 16 Apr 2014 13:01:09 +0000 Subject: [PATCH] Clean up non-fatal error handling - we know which error numbers we have defined. ok miod@ beck@ --- lib/libcrypto/bio/bss_dgram.c | 30 ------------------- lib/libcrypto/bio/bss_fd.c | 32 -------------------- lib/libcrypto/bio/bss_sock.c | 43 --------------------------- lib/libssl/src/crypto/bio/bss_dgram.c | 30 ------------------- lib/libssl/src/crypto/bio/bss_fd.c | 32 -------------------- lib/libssl/src/crypto/bio/bss_sock.c | 43 --------------------------- 6 files changed, 210 deletions(-) diff --git a/lib/libcrypto/bio/bss_dgram.c b/lib/libcrypto/bio/bss_dgram.c index 328bab9ce3c..9219fffc8d0 100644 --- a/lib/libcrypto/bio/bss_dgram.c +++ b/lib/libcrypto/bio/bss_dgram.c @@ -1687,41 +1687,11 @@ int BIO_dgram_non_fatal_error(int err) { switch (err) { - -#ifdef EWOULDBLOCK -# ifdef WSAEWOULDBLOCK -# if WSAEWOULDBLOCK != EWOULDBLOCK - case EWOULDBLOCK: -# endif -# else - case EWOULDBLOCK: -# endif -#endif - -#ifdef EINTR case EINTR: -#endif - -#ifdef EAGAIN -#if EWOULDBLOCK != EAGAIN case EAGAIN: -# endif -#endif - -#ifdef EPROTO - case EPROTO: -#endif - -#ifdef EINPROGRESS case EINPROGRESS: -#endif - -#ifdef EALREADY case EALREADY: -#endif - return (1); - /* break; */ default: break; } diff --git a/lib/libcrypto/bio/bss_fd.c b/lib/libcrypto/bio/bss_fd.c index 86757154e8a..c0e7f08fbb5 100644 --- a/lib/libcrypto/bio/bss_fd.c +++ b/lib/libcrypto/bio/bss_fd.c @@ -270,44 +270,12 @@ int BIO_fd_non_fatal_error(int err) { switch (err) { - -#ifdef EWOULDBLOCK -# ifdef WSAEWOULDBLOCK -# if WSAEWOULDBLOCK != EWOULDBLOCK - case EWOULDBLOCK: -# endif -# else - case EWOULDBLOCK: -# endif -#endif - -#if defined(ENOTCONN) case ENOTCONN: -#endif - -#ifdef EINTR case EINTR: -#endif - -#ifdef EAGAIN -#if EWOULDBLOCK != EAGAIN case EAGAIN: -# endif -#endif - -#ifdef EPROTO - case EPROTO: -#endif - -#ifdef EINPROGRESS case EINPROGRESS: -#endif - -#ifdef EALREADY case EALREADY: -#endif return (1); - /* break; */ default: break; } diff --git a/lib/libcrypto/bio/bss_sock.c b/lib/libcrypto/bio/bss_sock.c index 30640d8f962..c05b8d37f1d 100644 --- a/lib/libcrypto/bio/bss_sock.c +++ b/lib/libcrypto/bio/bss_sock.c @@ -233,55 +233,12 @@ int BIO_sock_non_fatal_error(int err) { switch (err) { -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) -# if defined(WSAEWOULDBLOCK) - case WSAEWOULDBLOCK: -# endif - -# if 0 /* This appears to always be an error */ -# if defined(WSAENOTCONN) - case WSAENOTCONN: -# endif -# endif -#endif - -#ifdef EWOULDBLOCK -# ifdef WSAEWOULDBLOCK -# if WSAEWOULDBLOCK != EWOULDBLOCK - case EWOULDBLOCK: -# endif -# else - case EWOULDBLOCK: -# endif -#endif - -#if defined(ENOTCONN) case ENOTCONN: -#endif - -#ifdef EINTR case EINTR: -#endif - -#ifdef EAGAIN -# if EWOULDBLOCK != EAGAIN case EAGAIN: -# endif -#endif - -#ifdef EPROTO - case EPROTO: -#endif - -#ifdef EINPROGRESS case EINPROGRESS: -#endif - -#ifdef EALREADY case EALREADY: -#endif return (1); - /* break; */ default: break; } diff --git a/lib/libssl/src/crypto/bio/bss_dgram.c b/lib/libssl/src/crypto/bio/bss_dgram.c index 328bab9ce3c..9219fffc8d0 100644 --- a/lib/libssl/src/crypto/bio/bss_dgram.c +++ b/lib/libssl/src/crypto/bio/bss_dgram.c @@ -1687,41 +1687,11 @@ int BIO_dgram_non_fatal_error(int err) { switch (err) { - -#ifdef EWOULDBLOCK -# ifdef WSAEWOULDBLOCK -# if WSAEWOULDBLOCK != EWOULDBLOCK - case EWOULDBLOCK: -# endif -# else - case EWOULDBLOCK: -# endif -#endif - -#ifdef EINTR case EINTR: -#endif - -#ifdef EAGAIN -#if EWOULDBLOCK != EAGAIN case EAGAIN: -# endif -#endif - -#ifdef EPROTO - case EPROTO: -#endif - -#ifdef EINPROGRESS case EINPROGRESS: -#endif - -#ifdef EALREADY case EALREADY: -#endif - return (1); - /* break; */ default: break; } diff --git a/lib/libssl/src/crypto/bio/bss_fd.c b/lib/libssl/src/crypto/bio/bss_fd.c index 86757154e8a..c0e7f08fbb5 100644 --- a/lib/libssl/src/crypto/bio/bss_fd.c +++ b/lib/libssl/src/crypto/bio/bss_fd.c @@ -270,44 +270,12 @@ int BIO_fd_non_fatal_error(int err) { switch (err) { - -#ifdef EWOULDBLOCK -# ifdef WSAEWOULDBLOCK -# if WSAEWOULDBLOCK != EWOULDBLOCK - case EWOULDBLOCK: -# endif -# else - case EWOULDBLOCK: -# endif -#endif - -#if defined(ENOTCONN) case ENOTCONN: -#endif - -#ifdef EINTR case EINTR: -#endif - -#ifdef EAGAIN -#if EWOULDBLOCK != EAGAIN case EAGAIN: -# endif -#endif - -#ifdef EPROTO - case EPROTO: -#endif - -#ifdef EINPROGRESS case EINPROGRESS: -#endif - -#ifdef EALREADY case EALREADY: -#endif return (1); - /* break; */ default: break; } diff --git a/lib/libssl/src/crypto/bio/bss_sock.c b/lib/libssl/src/crypto/bio/bss_sock.c index 30640d8f962..c05b8d37f1d 100644 --- a/lib/libssl/src/crypto/bio/bss_sock.c +++ b/lib/libssl/src/crypto/bio/bss_sock.c @@ -233,55 +233,12 @@ int BIO_sock_non_fatal_error(int err) { switch (err) { -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) -# if defined(WSAEWOULDBLOCK) - case WSAEWOULDBLOCK: -# endif - -# if 0 /* This appears to always be an error */ -# if defined(WSAENOTCONN) - case WSAENOTCONN: -# endif -# endif -#endif - -#ifdef EWOULDBLOCK -# ifdef WSAEWOULDBLOCK -# if WSAEWOULDBLOCK != EWOULDBLOCK - case EWOULDBLOCK: -# endif -# else - case EWOULDBLOCK: -# endif -#endif - -#if defined(ENOTCONN) case ENOTCONN: -#endif - -#ifdef EINTR case EINTR: -#endif - -#ifdef EAGAIN -# if EWOULDBLOCK != EAGAIN case EAGAIN: -# endif -#endif - -#ifdef EPROTO - case EPROTO: -#endif - -#ifdef EINPROGRESS case EINPROGRESS: -#endif - -#ifdef EALREADY case EALREADY: -#endif return (1); - /* break; */ default: break; } -- 2.20.1