Author: mturk Date: Mon Dec 14 07:19:55 2009 New Revision: 890201 URL: http://svn.apache.org/viewvc?rev=890201&view=rev Log: Use int descriptor directly
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java?rev=890201&r1=890200&r2=890201&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SharedMemory.java Mon Dec 14 07:19:55 2009 @@ -293,7 +293,7 @@ } } - private static native boolean chown0(Descriptor shm, int prot, + private static native boolean chown0(int shm, int prot, Descriptor uid, Descriptor gid) throws IOException, IndexOutOfBoundsException; /** @@ -305,7 +305,7 @@ public boolean setProtection(EnumSet<FileProtection> prot) throws IOException, SecurityException { - return chown0(shm, FileProtection.bitmapOf(prot), null, null); + return chown0(shm.fd(), FileProtection.bitmapOf(prot), null, null); } /** @@ -319,7 +319,7 @@ public boolean setProtection(User user, Group group, EnumSet<FileProtection> prot) throws IOException, SecurityException { - return chown0(shm, FileProtection.bitmapOf(prot), + return chown0(shm.fd(), FileProtection.bitmapOf(prot), user.Id, group.Id); } Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c?rev=890201&r1=890200&r2=890201&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c Mon Dec 14 07:19:55 2009 @@ -619,14 +619,12 @@ } ACR_JNI_EXPORT_DECLARE(jboolean, SharedMemory, chown0)(ACR_JNISTDARGS, - jobject shmd, jint perms, + jint shm, jint perms, jobject usr, jobject grp) { int ex = ACR_EINVAL; - int shm; UNREFERENCED_O; - shm = ACR_DescriptorGetInt(_E, shmd); if (shm > 0) { uid_t susr = ACR_DescriptorGetInt(_E, usr); gid_t sgrp = ACR_DescriptorGetInt(_E, grp); Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c?rev=890201&r1=890200&r2=890201&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c Mon Dec 14 07:19:55 2009 @@ -521,14 +521,12 @@ } ACR_JNI_EXPORT_DECLARE(jboolean, SharedMemory, chown0)(ACR_JNISTDARGS, - jobject shmd, jint perms, + jint shm, jint perms, jobject usr, jobject grp) { int ex = ACR_EINVAL; - int shm; UNREFERENCED_O; - shm = ACR_DescriptorGetInt(_E, shmd); if (shm > 0) { PSID susr = ACR_DescriptorGetPtr(_E, usr); PSID sgrp = ACR_DescriptorGetPtr(_E, grp);