commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
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 GMT
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);



Mime
View raw message