Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 2047 invoked from network); 16 Aug 2009 07:11:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Aug 2009 07:11:46 -0000 Received: (qmail 81543 invoked by uid 500); 16 Aug 2009 07:11:52 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 81460 invoked by uid 500); 16 Aug 2009 07:11:52 -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 81451 invoked by uid 99); 16 Aug 2009 07:11:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Aug 2009 07:11:52 +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; Sun, 16 Aug 2009 07:11:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3E7A123888ED; Sun, 16 Aug 2009 07:11:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r804636 - in /commons/sandbox/runtime/trunk/src/main/native/os: darwin/pmutex.c unix/pmutex.c unix/psema.c unix/shm.c win32/shm.c Date: Sun, 16 Aug 2009 07:11:30 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090816071130.3E7A123888ED@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Sun Aug 16 07:11:29 2009 New Revision: 804636 URL: http://svn.apache.org/viewvc?rev=804636&view=rev Log: Use EACCESS macro instead direct compare Modified: commons/sandbox/runtime/trunk/src/main/native/os/darwin/pmutex.c commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c 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/native/os/darwin/pmutex.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/darwin/pmutex.c?rev=804636&r1=804635&r2=804636&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/darwin/pmutex.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/darwin/pmutex.c Sun Aug 16 07:11:29 2009 @@ -97,7 +97,7 @@ free(m->fname); free(m); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c?rev=804636&r1=804635&r2=804636&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c Sun Aug 16 07:11:29 2009 @@ -83,7 +83,7 @@ } free(m); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c?rev=804636&r1=804635&r2=804636&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c Sun Aug 16 07:11:29 2009 @@ -75,10 +75,10 @@ if (rc) goto finally; rc = ACR_GET_OS_ERROR(); - if (rc == ENAMETOOLONG) { + if (errno == ENAMETOOLONG) { s->name[13] = '\0'; continue; - } else if (rc == EEXIST && !name) { + } else if (errno == EEXIST && !name) { if ((_sem_counter - ic) > 10) goto finally; sprintf(s->name, "/AcS.%06x%02x", @@ -102,7 +102,7 @@ if (rc) { free(s); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -138,7 +138,7 @@ if (rc) { x_free(s); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); 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=804636&r1=804635&r2=804636&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 Sun Aug 16 07:11:29 2009 @@ -182,7 +182,7 @@ finally: unlink(filename); if (rc && !IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -223,7 +223,7 @@ rc = ACR_GET_OS_ERROR(); free(shm); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -309,7 +309,7 @@ free((void *)(shm->filename)); free(shm); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -398,7 +398,7 @@ free((void *)(shm->filename)); free(shm); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -429,7 +429,7 @@ rc = acr_ioh_close(shm); finally: if (rc && !IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -463,7 +463,7 @@ finally: if (rc && !IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); 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=804636&r1=804635&r2=804636&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 Sun Aug 16 07:11:29 2009 @@ -280,7 +280,7 @@ if (rc) { free(shm); if (!IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -311,7 +311,7 @@ rc = acr_ioh_close(shm); finally: if (rc && !IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc); @@ -332,7 +332,7 @@ finally: if (rc && !IS_INVALID_HANDLE(_E)) { - if (rc == EACCES) + if (ACR_STATUS_IS_EACCES(rc)) ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0); else ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rc);