Skip to content

Commit

Permalink
Get flock-based mutexes to work in apps like Apache. Use the
Browse files Browse the repository at this point in the history
same permissions on flock- and fcntl-based mutexes as Apache
1.3.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63214 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
trawick committed Apr 1, 2002
1 parent 0d7fad0 commit e8131e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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]

Expand Down
10 changes: 6 additions & 4 deletions locks/unix/proc_mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e8131e6

Please sign in to comment.