summaryrefslogtreecommitdiffstats
path: root/contrib/apr/locks/unix/proc_mutex.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2014-05-27 07:15:14 +0000
committerpeter <peter@FreeBSD.org>2014-05-27 07:15:14 +0000
commit073d039ce1755179ade6d76571f16045ade34213 (patch)
tree0e023fb89b7a7e9a4fa11cfb7d9118a7510d2640 /contrib/apr/locks/unix/proc_mutex.c
parentc5be37fb1f34d0c40f8f70140824b785f414c4da (diff)
parentca02a2bfd2f08739388e00fb3bbe93fa3fa5efb0 (diff)
downloadFreeBSD-src-073d039ce1755179ade6d76571f16045ade34213.zip
FreeBSD-src-073d039ce1755179ade6d76571f16045ade34213.tar.gz
Merge apr-1.4.8 -> apr-1.5.1 and update.
Diffstat (limited to 'contrib/apr/locks/unix/proc_mutex.c')
-rw-r--r--contrib/apr/locks/unix/proc_mutex.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/apr/locks/unix/proc_mutex.c b/contrib/apr/locks/unix/proc_mutex.c
index f9637e0..fa8a872 100644
--- a/contrib/apr/locks/unix/proc_mutex.c
+++ b/contrib/apr/locks/unix/proc_mutex.c
@@ -102,8 +102,8 @@ static apr_status_t proc_mutex_posix_create(apr_proc_mutex_t *new_mutex,
apr_ssize_t flen = strlen(fname);
char *p = apr_pstrndup(new_mutex->pool, fname, strlen(fname));
unsigned int h1, h2;
- h1 = apr_hashfunc_default((const char *)p, &flen);
- h2 = rshash(p);
+ h1 = (apr_hashfunc_default((const char *)p, &flen) & 0xffffffff);
+ h2 = (rshash(p) & 0xffffffff);
apr_snprintf(semname, sizeof(semname), "/ApR.%xH%x", h1, h2);
} else {
apr_time_t now;
@@ -951,7 +951,12 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex,
apr_proc_mutex_t *pmutex)
{
#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE || APR_HAS_POSIXSEM_SERIALIZE
- ospmutex->crossproc = pmutex->interproc->filedes;
+ if (pmutex->interproc) {
+ ospmutex->crossproc = pmutex->interproc->filedes;
+ }
+ else {
+ ospmutex->crossproc = -1;
+ }
#endif
#if APR_HAS_PROC_PTHREAD_SERIALIZE
ospmutex->pthread_interproc = pmutex->pthread_interproc;
OpenPOWER on IntegriCloud