Commit c66adbab2d for openssl.org

commit c66adbab2d4ba677c38c23c24344ab755584c18b
Author: Bob Beck <beck@openssl.org>
Date:   Mon Aug 25 14:26:33 2025 -0600

    Use less preprocessor gymnastics for fatal error detection.

    We seem to be using a lot of preprocessor gymnastics to avoid
    having duplicate cases in a case statement depending on what
    the host system defines these values to.  We should not care.

    If we don't bother with the case statement this becomes
    easier to follow.

    While we are here, pick up the reccomended windows2 values
    that correspond with the POSIX values we already have
    in here that we believe are "non-fatal", and condition
    the codes to use on being windows or something POSIX.

    Reviewed-by: Neil Horman <nhorman@openssl.org>
    Reviewed-by: Richard Levitte <levitte@openssl.org>
    Reviewed-by: Tomas Mraz <tomas@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/28344)

diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
index 41b6965a80..a5b77c4a35 100644
--- a/crypto/bio/bss_sock.c
+++ b/crypto/bio/bss_sock.c
@@ -309,53 +309,23 @@ int BIO_sock_should_retry(int i)

 int BIO_sock_non_fatal_error(int err)
 {
-    switch (err) {
 # if defined(OPENSSL_SYS_WINDOWS)
-#  if defined(WSAEWOULDBLOCK)
-    case WSAEWOULDBLOCK:
+    return err == WSAEWOULDBLOCK
+        || err == WSAENOTCONN
+        || err == WSAEINTR
+        || err == WSAEINPROGRESS
+        || err == WSAEALREADY;
+# else /* POSIX.1-2001 */
+    return err == EWOULDBLOCK
+        || err == EAGAIN
+        || err == ENOTCONN
+        || err == EINTR
+#  if ! defined (__DJGPP__)
+        || err == EPROTO
 #  endif
+        || err == EINPROGRESS
+        || err == EALREADY;
 # 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;
-    default:
-        break;
-    }
-    return 0;
 }

 #endif                          /* #ifndef OPENSSL_NO_SOCK */