HDFS-8346. libwebhdfs build fails during link due to unresolved external symbols. Contributed by Chris Nauroth.

This commit is contained in:
Haohui Mai 2015-05-08 09:57:20 -07:00
parent 547b069887
commit d4d7d7bf22
4 changed files with 16 additions and 2 deletions

View File

@ -368,6 +368,9 @@ Release 2.8.0 - UNRELEASED
HDFS-6285. tidy an error log inside BlockReceiver. (Liang Xie via umamahesh)
HDFS-8346. libwebhdfs build fails during link due to unresolved external
symbols. (Chris Nauroth via wheat9)
Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -31,6 +31,9 @@ add_dual_library(webhdfs
src/hdfs_json_parser.c
../../main/native/libhdfs/exception.c
../../main/native/libhdfs/jni_helper.c
../../${OS_DIR}/mutexes.c
../../${OS_DIR}/thread_local_storage.c
../../main/native/libhdfs/common/htable.c
)
target_link_dual_libraries(webhdfs
${JAVA_JVM_LIBRARY}

View File

@ -28,7 +28,15 @@ static volatile int curlGlobalInited = 0;
const char *hdfs_strerror(int errnoval)
{
return terror(errnoval);
#if defined(__sun)
// MT-Safe under Solaris which doesn't support sys_errlist/sys_nerr
return strerror(errnoval);
#else
if ((errnoval < 0) || (errnoval >= sys_nerr)) {
return "unknown error.";
}
return sys_errlist[errnoval];
#endif
}
int initResponseBuffer(struct ResponseBuffer **buffer)

View File

@ -284,7 +284,7 @@ int launchDnAPPEND(const char *url, struct webhdfsBuffer *buffer,
struct Response **response) __attribute__ ((warn_unused_result));
/**
* Call sys_errlist to get the error message string for the given error code
* Thread-safe strerror alternative.
*
* @param errnoval The error code value
* @return The error message string mapped to the given error code