This is an automated email from the ASF dual-hosted git repository. stevel pushed a commit to branch branch-3.4 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.4 by this push: new 49da40426b53 HADOOP-19170. Fixes compilation issues on non-Linux systems (#6822) 49da40426b53 is described below commit 49da40426b530ff23f4cdfa20a8b685cd8626f59 Author: zhengchenyu <zhengcheny...@163.com> AuthorDate: Wed May 15 21:30:10 2024 +0800 HADOOP-19170. Fixes compilation issues on non-Linux systems (#6822) Contributed by zhengchenyu --- .../hadoop-common/src/main/native/src/exception.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/exception.c b/hadoop-common-project/hadoop-common/src/main/native/src/exception.c index a25cc3d3b7ee..b4a9b8128039 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/exception.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/exception.c @@ -110,9 +110,16 @@ jthrowable newIOException(JNIEnv* env, const char *fmt, ...) const char* terror(int errnum) { - -#if defined(__sun) || defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 32) // MT-Safe under Solaris or glibc >= 2.32 not supporting sys_errlist/sys_nerr +#if defined(__sun) + #define USE_STR_ERROR +#elif defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 32) + #define USE_STR_ERROR + #endif +#endif + +#if defined(USE_STR_ERROR) return strerror(errnum); #else if ((errnum < 0) || (errnum >= sys_nerr)) { @@ -121,4 +128,3 @@ const char* terror(int errnum) return sys_errlist[errnum]; #endif } - --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org