You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/18 19:48:31 UTC

svn commit: r805511 - /commons/sandbox/runtime/trunk/src/main/native/os/win32/shm.c

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);