HADOOP-10810. Clean up native code compilation warnings. Contributed by Chris Nauroth.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1610524 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3b54223c0f
commit
9fc972499f
@ -410,6 +410,8 @@ Release 2.6.0 - UNRELEASED
|
||||
HADOOP-10780. hadoop_user_info_alloc fails on FreeBSD due to incorrect
|
||||
sysconf use (Dmitry Sivachenko via Colin Patrick McCabe)
|
||||
|
||||
HADOOP-10810. Clean up native code compilation warnings. (cnauroth)
|
||||
|
||||
Release 2.5.0 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -379,6 +379,7 @@ Java_org_apache_hadoop_io_compress_zlib_ZlibCompressor_getLibraryName(JNIEnv *en
|
||||
return (*env)->NewStringUTF(env, dl_info.dli_fname);
|
||||
}
|
||||
}
|
||||
return (*env)->NewStringUTF(env, "Unavailable");
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS
|
||||
|
@ -580,6 +580,8 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_getUserName(
|
||||
JNIEnv *env, jclass clazz, jint uid)
|
||||
{
|
||||
#ifdef UNIX
|
||||
jstring jstr_username = NULL;
|
||||
char *pw_buf = NULL;
|
||||
int pw_lock_locked = 0;
|
||||
if (pw_lock_object != NULL) {
|
||||
if ((*env)->MonitorEnter(env, pw_lock_object) != JNI_OK) {
|
||||
@ -588,7 +590,6 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_getUserName(
|
||||
pw_lock_locked = 1;
|
||||
}
|
||||
|
||||
char *pw_buf = NULL;
|
||||
int rc;
|
||||
size_t pw_buflen = get_pw_buflen();
|
||||
if ((pw_buf = malloc(pw_buflen)) == NULL) {
|
||||
@ -623,7 +624,7 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_getUserName(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
jstring jstr_username = (*env)->NewStringUTF(env, pwd.pw_name);
|
||||
jstr_username = (*env)->NewStringUTF(env, pwd.pw_name);
|
||||
|
||||
cleanup:
|
||||
if (pw_lock_locked) {
|
||||
@ -664,7 +665,7 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_mmap(
|
||||
#ifdef WINDOWS
|
||||
THROW(env, "java/io/IOException",
|
||||
"The function POSIX.mmap() is not supported on Windows");
|
||||
return NULL;
|
||||
return (jlong)(intptr_t)NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -684,7 +685,6 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_munmap(
|
||||
#ifdef WINDOWS
|
||||
THROW(env, "java/io/IOException",
|
||||
"The function POSIX.munmap() is not supported on Windows");
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -700,6 +700,8 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_getGroupName(
|
||||
JNIEnv *env, jclass clazz, jint gid)
|
||||
{
|
||||
#ifdef UNIX
|
||||
jstring jstr_groupname = NULL;
|
||||
char *pw_buf = NULL;
|
||||
int pw_lock_locked = 0;
|
||||
|
||||
if (pw_lock_object != NULL) {
|
||||
@ -709,7 +711,6 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_getGroupName(
|
||||
pw_lock_locked = 1;
|
||||
}
|
||||
|
||||
char *pw_buf = NULL;
|
||||
int rc;
|
||||
size_t pw_buflen = get_pw_buflen();
|
||||
if ((pw_buf = malloc(pw_buflen)) == NULL) {
|
||||
@ -744,7 +745,7 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024POSIX_getGroupName(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
jstring jstr_groupname = (*env)->NewStringUTF(env, grp.gr_name);
|
||||
jstr_groupname = (*env)->NewStringUTF(env, grp.gr_name);
|
||||
PASS_EXCEPTIONS_GOTO(env, cleanup);
|
||||
|
||||
cleanup:
|
||||
@ -922,7 +923,7 @@ Java_org_apache_hadoop_io_nativeio_NativeIO_00024Windows_setFilePointer
|
||||
#ifdef UNIX
|
||||
THROW(env, "java/io/IOException",
|
||||
"The function setFilePointer(FileDescriptor) is not supported on Unix");
|
||||
return NULL;
|
||||
return (jlong)(intptr_t)NULL;
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS
|
||||
@ -957,7 +958,7 @@ JNIEXPORT jboolean JNICALL Java_org_apache_hadoop_io_nativeio_NativeIO_00024Wind
|
||||
#ifdef UNIX
|
||||
THROW(env, "java/io/IOException",
|
||||
"The function access0(path, access) is not supported on Unix");
|
||||
return NULL;
|
||||
return (jlong)(intptr_t)NULL;
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS
|
||||
|
@ -120,17 +120,19 @@ Java_org_apache_hadoop_net_unix_DomainSocketWatcher_00024FdSet_remove(
|
||||
JNIEnv *env, jobject obj, jint fd)
|
||||
{
|
||||
struct fd_set_data *sd;
|
||||
struct pollfd *pollfd, *last_pollfd;
|
||||
struct pollfd *pollfd = NULL, *last_pollfd;
|
||||
int used_size, i;
|
||||
|
||||
sd = (struct fd_set_data*)(intptr_t)(*env)->
|
||||
GetLongField(env, obj, fd_set_data_fid);
|
||||
used_size = sd->used_size;
|
||||
for (i = 0; i < used_size; i++) {
|
||||
pollfd = sd->pollfd + i;
|
||||
if (pollfd->fd == fd) break;
|
||||
if (sd->pollfd[i].fd == fd) {
|
||||
pollfd = sd->pollfd + i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == used_size) {
|
||||
if (pollfd == NULL) {
|
||||
(*env)->Throw(env, newRuntimeException(env, "failed to remove fd %d "
|
||||
"from the FdSet because it was never present.", fd));
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@ static void throw_ioexception(JNIEnv* env, DWORD errnum)
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, *(DWORD*) (&errnum), // reinterpret cast
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPSTR*)&buffer, 0, NULL);
|
||||
buffer, 0, NULL);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user