commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r805511 - /commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c
Date Tue, 18 Aug 2009 17:48:31 GMT
Author: mturk
Date: Tue Aug 18 17:48:30 2009
New Revision: 805511

URL: http://svn.apache.org/viewvc?rev=805511&view=rev
Log:
Do not fail if backing file cannot be removed

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

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=805511&r1=805510&r2=805511&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 Tue Aug 18 17:48:30 2009
@@ -56,13 +56,15 @@
     if (m->memblk && !UnmapViewOfFile(m->memblk)) {
         rc = ACR_GET_OS_ERROR();
     }
-    if (!CloseHandle(m->hmap) && rc) {
+    if (!CloseHandle(m->hmap) && rc == 0) {
         rc = ACR_GET_OS_ERROR();
     }
     if (m->filename) {
-        /* Remove file if file backed */
-        if (!DeleteFileW(m->filename) && rc)
-            rc = ACR_GET_OS_ERROR();
+        /* Remove file if file backed.
+         * The call will fail if there are still shared
+         * memory segments attached to it. 
+         */
+        DeleteFileW(m->filename);
         free((void *)(m->filename));
     }
     x_free(m);



Mime
View raw message