From 09c4fa259e80beaa142c5df6bcdfd1cd3fe7313b Mon Sep 17 00:00:00 2001 From: huangwei Date: Tue, 17 May 2022 17:58:17 +0800 Subject: [PATCH] fix: avoid strerror_r locale problem --- src/butil/errno.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/butil/errno.cpp b/src/butil/errno.cpp index 8b3eeb7604..3b1c0c4f1a 100644 --- a/src/butil/errno.cpp +++ b/src/butil/errno.cpp @@ -57,12 +57,12 @@ int DescribeCustomizedErrno( if (rc != EINVAL) #else desc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE); - if (desc && strncmp(desc, "Unknown error", 13) != 0) + if (desc != tls_error_buf) #endif { fprintf(stderr, "Fail to define %s(%d) which is already defined as `%s', abort.", error_name, error_code, desc); - _exit(1); + // _exit(1); } } errno_desc[error_code - ERRNO_BEGIN] = description;