Skip to content

Commit

Permalink
fix: avoid strerror_r locale problem
Browse files Browse the repository at this point in the history
  • Loading branch information
vagetablechicken committed May 18, 2022
1 parent c94030a commit 09c4fa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/butil/errno.cpp
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 09c4fa2

Please sign in to comment.