Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 310BA11DAC for ; Sun, 13 Apr 2014 18:14:07 +0000 (UTC) Received: (qmail 31598 invoked by uid 500); 13 Apr 2014 18:14:05 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 31562 invoked by uid 500); 13 Apr 2014 18:14:04 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 31555 invoked by uid 99); 13 Apr 2014 18:14:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Apr 2014 18:14:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Apr 2014 18:14:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 20806238890D; Sun, 13 Apr 2014 18:13:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@apr.apache.org From: trawick@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140413181342.20806238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 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 ] + *) 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;