Clean up non-fatal error handling - we know which error numbers we have
authorjsing <jsing@openbsd.org>
Wed, 16 Apr 2014 13:01:09 +0000 (13:01 +0000)
committerjsing <jsing@openbsd.org>
Wed, 16 Apr 2014 13:01:09 +0000 (13:01 +0000)
defined.

ok miod@ beck@

lib/libcrypto/bio/bss_dgram.c
lib/libcrypto/bio/bss_fd.c
lib/libcrypto/bio/bss_sock.c
lib/libssl/src/crypto/bio/bss_dgram.c
lib/libssl/src/crypto/bio/bss_fd.c
lib/libssl/src/crypto/bio/bss_sock.c

index 328bab9..9219fff 100644 (file)
@@ -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;
        }
index 8675715..c0e7f08 100644 (file)
@@ -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;
        }
index 30640d8..c05b8d3 100644 (file)
@@ -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;
        }
index 328bab9..9219fff 100644 (file)
@@ -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;
        }
index 8675715..c0e7f08 100644 (file)
@@ -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;
        }
index 30640d8..c05b8d3 100644 (file)
@@ -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;
        }