diff options
author | Jeff Trawick <trawick@apache.org> | 2003-06-07 12:37:48 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2003-06-07 12:37:48 +0000 |
commit | 8337c716185eae5e5dfd9bc9b6caa4bc26bef083 (patch) | |
tree | 18b017b3a8bed1160a284ec379b9f8af10700fc3 | |
parent | 5962e34aa70f64bf38781780bb7fe3d1a3241fb2 (diff) | |
download | apr-8337c716185eae5e5dfd9bc9b6caa4bc26bef083.tar.gz |
Don't require the lock file name to be passed into
apr_proc_mutex_child_init() or apr_global_mutex_child_init().
This allows child init to work when the lock file was a temp
file created by APR. (The problem only occurred with flock-
based mutexes.)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64530 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | locks/unix/proc_mutex.c | 3 |
2 files changed, 9 insertions, 0 deletions
@@ -1,5 +1,11 @@ Changes with APR 0.9.4 + *) Don't require the lock file name to be passed into + apr_proc_mutex_child_init() or apr_global_mutex_child_init(). + This allows child init to work when the lock file was a temp + file created by APR. (The problem only occurred with flock- + based mutexes.) [Jeff Trawick] + *) When using a temporary file for flock- and fcntl-based mutexes, don't let the file be deleted on close. For flock-based mutexes, this corrects a fatal problem, since the file would disappear diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 1ad35de4a..2f2a1a626 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -682,6 +682,9 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex, memcpy(new_mutex, *mutex, sizeof *new_mutex); new_mutex->pool = pool; + if (!fname) { + fname = (*mutex)->fname; + } new_mutex->fname = apr_pstrdup(pool, fname); rv = apr_file_open(&new_mutex->interproc, new_mutex->fname, APR_WRITE, 0, new_mutex->pool); |