On Wed, 2008-05-28 at 14:29 +1000, Bojan Smojver wrote:

> Something like this (possibly required in other places too).

Sorry, forgot to modify the header file. BTW, this patch makes it pass
the tests.

PS. Obviously, similar things may need to be applied to other places in
the same function.

-- 
Bojan
Index: include/arch/unix/apr_arch_shm.h
===================================================================
--- include/arch/unix/apr_arch_shm.h	(revision 660812)
+++ include/arch/unix/apr_arch_shm.h	(working copy)
@@ -27,6 +27,9 @@
 #include "apr_network_io.h"
 #include "apr_portable.h"
 
+#if APR_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
Index: shmem/unix/shm.c
===================================================================
--- shmem/unix/shm.c	(revision 660812)
+++ shmem/unix/shm.c	(working copy)
@@ -70,7 +70,12 @@
         if (shmdt(m->base) == -1) {
             return errno;
         }
-        return apr_file_remove(m->filename, m->pool);
+        if (access(m->filename, F_OK)) {
+            return APR_SUCCESS;
+        }
+        else {
+            return apr_file_remove(m->filename, m->pool);
+        }
 #endif
     }
 

Reply via email to