summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2002-04-01 21:03:04 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2002-04-01 21:03:04 +0000
commit96cc314ca75e0a44c7a49cff6e5dbc43ff9b7c42 (patch)
treef1cb18eecdff6c5801af36e48a35eedc557ac983
parent5874395a81b050656dce23b7e7690b23f9f4d44c (diff)
downloadlibapr-96cc314ca75e0a44c7a49cff6e5dbc43ff9b7c42.tar.gz
Get flock-based mutexes to work in apps like Apache. Use the
same permissions on flock- and fcntl-based mutexes as Apache 1.3. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63214 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES4
-rw-r--r--locks/unix/proc_mutex.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index fc8f40c33..7e7e94ca2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
Changes with APR b1
+ *) Get flock-based mutexes to work in apps like Apache. Use the
+ same permissions on flock- and fcntl-based mutexes as Apache
+ 1.3. [Jeff Trawick]
+
*) Fix apr-config so that it will not attempt to cd to a non-existent
directory. [Justin Erenkrantz]
diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c
index 77eaccf8c..b855d00e6 100644
--- a/locks/unix/proc_mutex.c
+++ b/locks/unix/proc_mutex.c
@@ -390,7 +390,8 @@ static apr_status_t proc_mutex_fcntl_create(apr_proc_mutex_t *new_mutex,
if (fname) {
new_mutex->fname = apr_pstrdup(new_mutex->pool, fname);
rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
- APR_CREATE | APR_WRITE | APR_EXCL, 0644,
+ APR_CREATE | APR_WRITE | APR_EXCL,
+ APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD,
new_mutex->pool);
}
else {
@@ -511,7 +512,8 @@ static apr_status_t proc_mutex_flock_create(apr_proc_mutex_t *new_mutex,
if (fname) {
new_mutex->fname = apr_pstrdup(new_mutex->pool, fname);
rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
- APR_CREATE | APR_WRITE | APR_EXCL, 0644,
+ APR_CREATE | APR_WRITE | APR_EXCL,
+ APR_UREAD | APR_UWRITE,
new_mutex->pool);
}
else {
@@ -582,10 +584,10 @@ static apr_status_t proc_mutex_flock_child_init(apr_proc_mutex_t **mutex,
new_mutex->pool = pool;
new_mutex->fname = apr_pstrdup(pool, fname);
rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
- APR_CREATE | APR_WRITE, 0600, new_mutex->pool);
+ APR_WRITE, 0, new_mutex->pool);
if (rv != APR_SUCCESS) {
proc_mutex_flock_destroy(new_mutex);
- return errno;
+ return rv;
}
*mutex = new_mutex;
return APR_SUCCESS;