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.82~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1854%2Fhead;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 --- diff --git a/src/java/native/libcephfs_jni.cc b/src/java/native/libcephfs_jni.cc index 189743d69900..a96b20d95598 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