apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject we're missing a lock file unlink(); worker MPM can't restart
Date Tue, 23 Oct 2001 18:44:20 GMT
In proc_mutex_fcntl_create() in proc_mutex.c, unlink() is commented
out.  The file needs to be unlinked somehow.  The patch below unlinks
it as soon as it is created, but I think that is inconsistent with how
a lock file created by apr_file_mkstemp() will be handled.

Maybe we need to pass the delete-on-close flag to apr_file_open()?

Index: srclib/apr/locks/unix/proc_mutex.c
===================================================================
RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
retrieving revision 1.6
diff -u -r1.6 proc_mutex.c
--- srclib/apr/locks/unix/proc_mutex.c	2001/10/23 17:46:56	1.6
+++ srclib/apr/locks/unix/proc_mutex.c	2001/10/23 18:28:46
@@ -392,6 +392,9 @@
         rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
                            APR_CREATE | APR_WRITE | APR_EXCL, 0644, 
                            new_mutex->pool);
+        if (rv == APR_SUCCESS) {
+            unlink(new_mutex->fname);
+        }
     }
     else {
         new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX");
@@ -405,7 +408,6 @@
     }
 
     new_mutex->curr_locked = 0;
-/*    unlink(new_mutex->fname); */
     apr_pool_cleanup_register(new_mutex->pool,
                               (void*)new_mutex,
                               proc_mutex_fcntl_cleanup, 

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message