From: Greg Farnum Date: Thu, 22 May 2014 04:41:23 +0000 (-0700) Subject: cephfs-java: build against older jni headers X-Git-Tag: v0.67.11~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e90b04d9452999d7d91305c80585782d492c91b;p=ceph.git cephfs-java: build against older jni headers Older versions of the JNI interface expected non-const parameters to their memory move functions. It's unpleasant, but won't actually change the memory in question, to do a cast_const in order to satisfy those older headers. (And even if it *did* modify the memory, that would be okay given our single user.) Signed-off-by: Greg Farnum (cherry picked from commit 4d4b77e5b6b923507ec4a0ad9d5c7018e4542a3c) --- diff --git a/src/java/native/libcephfs_jni.cc b/src/java/native/libcephfs_jni.cc index 189743d6990..a96b20d9559 100644 --- a/src/java/native/libcephfs_jni.cc +++ b/src/java/native/libcephfs_jni.cc @@ -2875,7 +2875,7 @@ jobject sockaddrToInetAddress(JNIEnv* env, const sockaddr_storage& ss, jint* por return NULL; } env->SetByteArrayRegion(byteArray.get(), 0, addressLength, - reinterpret_cast(rawAddress)); + reinterpret_cast(const_cast(rawAddress))); if (ss.ss_family == AF_UNIX) { // Note that we get here for AF_UNIX sockets on accept(2). The unix(7) man page claims