apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1587063 - /apr/apr/trunk/locks/unix/proc_mutex.c
Date Sun, 13 Apr 2014 18:05:38 GMT
Author: trawick
Date: Sun Apr 13 18:05:37 2014
New Revision: 1587063

URL: http://svn.apache.org/r1587063
Log:
apr_os_proc_mutex_get() on Unix:  Avoid segfault for cross-
process pthread mutexes.

Submitted by: Yann Ylavic <ylavic.dev gmail.com>
Reviewed by: trawick

Modified:
    apr/apr/trunk/locks/unix/proc_mutex.c

Modified: apr/apr/trunk/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/locks/unix/proc_mutex.c?rev=1587063&r1=1587062&r2=1587063&view=diff
==============================================================================
--- apr/apr/trunk/locks/unix/proc_mutex.c (original)
+++ apr/apr/trunk/locks/unix/proc_mutex.c Sun Apr 13 18:05:37 2014
@@ -1013,7 +1013,12 @@ APR_DECLARE(apr_status_t) apr_os_proc_mu
                                                 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;



Mime
View raw message