Skip to content

Commit

Permalink
leave macos exit
Browse files Browse the repository at this point in the history
  • Loading branch information
vagetablechicken committed May 18, 2022
1 parent 6aa4c10 commit fc41116
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/butil/errno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ int DescribeCustomizedErrno(
} else {
#if defined(OS_MACOSX)
const int rc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE);
if (rc != EINVAL)
if (rc != EINVAL) {
fprintf(stderr, "Fail to define %s(%d) which is already defined as `%s', abort.",
error_name, error_code, desc);
_exit(1);
}
#else
desc = strerror_r(error_code, tls_error_buf, ERROR_BUFSIZE);
if (desc != tls_error_buf)
#endif
{
if (desc != tls_error_buf) {
fprintf(stderr,
"%d is defined as `%s', probably is the system errno.\n",
error_code, desc);
}
#endif
}
errno_desc[error_code - ERRNO_BEGIN] = description;
return 0; // must
Expand Down

0 comments on commit fc41116

Please sign in to comment.