Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 9886 invoked from network); 6 Aug 2009 17:48:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Aug 2009 17:48:09 -0000 Received: (qmail 39496 invoked by uid 500); 6 Aug 2009 17:48:16 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 39399 invoked by uid 500); 6 Aug 2009 17:48:16 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 39372 invoked by uid 99); 6 Aug 2009 17:48:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2009 17:48:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2009 17:48:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6FEF023888AD; Thu, 6 Aug 2009 17:47:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r801745 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_shm.h os/unix/shm.c test/testcase.c Date: Thu, 06 Aug 2009 17:47:46 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090806174746.6FEF023888AD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Thu Aug 6 17:47:45 2009 New Revision: 801745 URL: http://svn.apache.org/viewvc?rev=801745&view=rev Log: use only close instead destroy/detach Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_shm.h commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c commons/sandbox/runtime/trunk/src/main/native/test/testcase.c Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_shm.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_shm.h?rev=801745&r1=801744&r2=801745&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/include/acr_shm.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr_shm.h Thu Aug 6 17:47:45 2009 @@ -75,19 +75,12 @@ const acr_pchar_t *filename); /** - * Destroy a shared memory segment and associated memory. - * @param env JNI environment to use. - * @param m The shared memory segment structure to destroy. - */ -ACR_DECLARE(int) ACR_ShmDestroy(JNIEnv *env, int m); - -/** - * Detach from a shared memory segment without destroying it. + * Destroy or detach from a shared memory segment. * @param env JNI environment to use. * @param m The shared memory structure representing the segment - * to detach from. + * to destroy or detach from. */ -ACR_DECLARE(int) ACR_ShmDetach(JNIEnv *env, int m); +ACR_DECLARE(int) ACR_ShmClose(JNIEnv *env, int m); /** * Remove named resource associated with a shared memory segment, 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=801745&r1=801744&r2=801745&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 Thu Aug 6 17:47:45 2009 @@ -117,34 +117,6 @@ return rc; } -ACR_DECLARE(int) ACR_ShmDestroy(JNIEnv *_E, int shm) -{ - int rv; - - rv = acr_ioh_close(shm); - if (rv && !IS_INVALID_HANDLE(_E)) { - if (rv == EACCES) - ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); - else - ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rv); - } - return rv; -} - -ACR_DECLARE(int) ACR_ShmDetach(JNIEnv *_E, int shm) -{ - int rv; - - rv = acr_ioh_close(shm); - if (rv && !IS_INVALID_HANDLE(_E)) { - if (rv == EACCES) - ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); - else - ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rv); - } - return rv; -} - ACR_DECLARE(int) ACR_ShmClose(JNIEnv *_E, int shm) { int rv; Modified: commons/sandbox/runtime/trunk/src/main/native/test/testcase.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testcase.c?rev=801745&r1=801744&r2=801745&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/test/testcase.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/test/testcase.c Thu Aug 6 17:47:45 2009 @@ -663,7 +663,7 @@ ACR_JNI_EXPORT_DECLARE(jint, TestPrivate, test062)(ACR_JNISTDARGS, jint s) { - return ACR_ShmDestroy(_E, s); + return ACR_ShmClose(_E, s); } ACR_JNI_EXPORT_DECLARE(jint, TestPrivate, test063)(ACR_JNISTDARGS, jint d) @@ -678,7 +678,7 @@ ACR_JNI_EXPORT_DECLARE(jint, TestPrivate, test065)(ACR_JNISTDARGS, jint s) { - return ACR_ShmDetach(_E, s); + return ACR_ShmClose(_E, s); } ACR_JNI_EXPORT_DECLARE(jint, TestPrivate, test066)(ACR_JNISTDARGS, jint s)