commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r806084 - /commons/sandbox/runtime/trunk/src/main/native/os/win32/pshm.c
Date Thu, 20 Aug 2009 08:15:05 GMT
Author: mturk
Date: Thu Aug 20 08:15:05 2009
New Revision: 806084

URL: http://svn.apache.org/viewvc?rev=806084&view=rev
Log:
Throw exception on failed remove

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/pshm.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/pshm.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/pshm.c?rev=806084&r1=806083&r2=806084&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/pshm.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/pshm.c Thu Aug 20 08:15:05 2009
@@ -89,7 +89,7 @@
 
     rv = acr_ioh_close(shm);
     if (rv  && IS_VALID_HANDLE(_E)) {
-        if (rv == EACCES)
+        if (ACR_STATUS_IS_EACCES(rv))
             ACR_ThrowException(_E, THROW_NMARK, ACR_EX_ESECURITY, 0);
         else
             ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EIO, rv);
@@ -102,6 +102,12 @@
     int rc = 0;
     if (!DeleteFileW(filename))
         rc = ACR_GET_OS_ERROR();
+    if (rc  && IS_VALID_HANDLE(_E)) {
+        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);
+    }
     return rc;
 }
 
@@ -243,7 +249,7 @@
         x_free((void *)(shm->filename));
         x_free(shm);
         if (IS_VALID_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