apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1587064 - in /apr/apr/branches/1.5.x: ./ CHANGES locks/unix/proc_mutex.c
Date Sun, 13 Apr 2014 18:13:42 GMT
Author: trawick
Date: Sun Apr 13 18:13:41 2014
New Revision: 1587064

URL: http://svn.apache.org/r1587064
Log:
Merge r1587063 from trunk:

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/branches/1.5.x/   (props changed)
    apr/apr/branches/1.5.x/CHANGES
    apr/apr/branches/1.5.x/locks/unix/proc_mutex.c

Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1587063

Modified: apr/apr/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?rev=1587064&r1=1587063&r2=1587064&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.5.x/CHANGES [utf-8] Sun Apr 13 18:13:41 2014
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.5.1
 
+  *) apr_os_proc_mutex_get() on Unix:  Avoid segfault for cross-
+     process pthread mutexes.  [Yann Ylavic <ylavic.dev gmail.com>]
+
   *) When using shmget-based shared memory, the ID used for ftok is
      now an APR hash of the filename instead of the constant '1'.
      We do this to help avoid collisions. PR 53996 [Jim Jagielski]

Modified: apr/apr/branches/1.5.x/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/locks/unix/proc_mutex.c?rev=1587064&r1=1587063&r2=1587064&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/locks/unix/proc_mutex.c (original)
+++ apr/apr/branches/1.5.x/locks/unix/proc_mutex.c Sun Apr 13 18:13:41 2014
@@ -951,7 +951,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