Reapply strerror_r change on top of 3.0.7
@@ -299,28 +299,28 @@ int openssl_strerror_r(int errnum, char *buf, size_t buflen)
#if defined(_MSC_VER) && _MSC_VER>=1400 && !defined(_WIN32_WCE)
return !strerror_s(buf, buflen, errnum);
#elif defined(_GNU_SOURCE)
- char *err;
-
- /*
- * GNU strerror_r may not actually set buf.
- * It can return a pointer to some (immutable) static string in which case
- * buf is left unused.
- */
- err = strerror_r(errnum, buf, buflen);
- if (err == NULL || buflen == 0)
- return 0;
- /*
- * If err is statically allocated, err != buf and we need to copy the data.
- * If err points somewhere inside buf, OPENSSL_strlcpy can handle this,
- * since src and dest are not annotated with __restrict and the function
- * reads src byte for byte and writes to dest.
- * If err == buf we do not have to copy anything.
- */
- if (err != buf)
- OPENSSL_strlcpy(buf, err, buflen);
- return 1;
-#elif (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \
- (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
+// char *err;
+
+// /*
+// * GNU strerror_r may not actually set buf.
+// * It can return a pointer to some (immutable) static string in which case
+// * buf is left unused.
+// */
+// err = strerror_r(errnum, buf, buflen);
+// if (err == NULL || buflen == 0)
+// return 0;
+// /*
+// * If err is statically allocated, err != buf and we need to copy the data.
+// * If err points somewhere inside buf, OPENSSL_strlcpy can handle this,
+// * since src and dest are not annotated with __restrict and the function
+// * reads src byte for byte and writes to dest.
+// * If err == buf we do not have to copy anything.
+// */
+// if (err != buf)
+// OPENSSL_strlcpy(buf, err, buflen);
+// return 1;
+// #elif (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \
+// (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
/*
* We can use "real" strerror_r. The OpenSSL version differs in that it
* gives 1 on success and 0 on failure for consistency with other OpenSSL
