trawick 01/10/25 07:52:43
Modified: locks/unix proc_mutex.c
Log:
Change proc_mutex_fcntl_create() to remove the lock file. There was
no logic to unlink() the lock file when the user specified the name,
though when the APR temporary file facility was used it would be
unlinked when closed.
For an fcntl() lock we want to remove the file immediately (not
necessary to open it again; don't want to leave it around if we
die catastrophically).
Revision Changes Path
1.8 +6 -1 apr/locks/unix/proc_mutex.c
Index: proc_mutex.c
===================================================================
RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- proc_mutex.c 2001/10/23 19:48:29 1.7
+++ proc_mutex.c 2001/10/25 14:52:43 1.8
@@ -405,7 +405,12 @@
}
new_mutex->curr_locked = 0;
-/* unlink(new_mutex->fname); */
+ /* XXX currently, apr_file_mktemp() always specifies that the file should
+ * be removed when closed; that unlink() will fail since we're
+ * removing it here; we want to remove it here since we don't need
+ * it visible and we want it cleaned up if we exit catastrophically
+ */
+ unlink(new_mutex->fname);
apr_pool_cleanup_register(new_mutex->pool,
(void*)new_mutex,
proc_mutex_fcntl_cleanup,