summaryrefslogtreecommitdiff
path: root/locks
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-07-19 17:42:55 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-07-19 17:42:55 +0000
commit8bc0996ae1663c4d01430b211db4059d6d5afc3b (patch)
treeca6b52794b5e865dd2214033b01c6fca741ec325 /locks
parentaa54ab4a2bdd6dc2bbbdfd948e8edb59f8ef0d86 (diff)
downloadlibapr-8bc0996ae1663c4d01430b211db4059d6d5afc3b.tar.gz
Make ap_child_init_lock() work properly... It didn't
call ap_unix_child_init_lock() at the right time, so any lock mechanism which had interesting work to do (only flock()) was broken. Fix the flock() flavor of ap_unix_child_init_lock(). It expected to create the lock file when it should in fact open the existing one. It also neglected to return the new ap_lock_t structure to the caller. Improve logging of lock init errors in prefork (I know, prefork is a lame duck, but I used the improved logging in prefork to help debug the problem). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60393 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks')
-rw-r--r--locks/unix/crossproc.c3
-rw-r--r--locks/unix/locks.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c
index 2b0fb74aa..274b9d89a 100644
--- a/locks/unix/crossproc.c
+++ b/locks/unix/crossproc.c
@@ -422,11 +422,12 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont,
new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t));
new->fname = ap_pstrdup(cont, fname);
- new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
+ new->interproc = open(new->fname, O_WRONLY, 0600);
if (new->interproc == -1) {
ap_unix_destroy_inter_lock(new);
return errno;
}
+ *lock = new;
return APR_SUCCESS;
}
diff --git a/locks/unix/locks.c b/locks/unix/locks.c
index 8e9784017..823c9ca37 100644
--- a/locks/unix/locks.c
+++ b/locks/unix/locks.c
@@ -159,7 +159,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname,
ap_pool_t *cont)
{
ap_status_t stat;
- if ((*lock)->scope != APR_CROSS_PROCESS) {
+ if ((*lock)->scope != APR_INTRAPROCESS) {
if ((stat = ap_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) {
return stat;
}