From owner-svn-soc-all@FreeBSD.ORG Mon Jul 2 13:09:31 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 60826106564A for ; Mon, 2 Jul 2012 13:09:29 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 02 Jul 2012 13:09:29 +0000 Date: Mon, 02 Jul 2012 13:09:29 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120702130929.60826106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r238800 - in soc2012/gmiller/locking-head: . lib/libwitness X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 13:09:31 -0000 Author: gmiller Date: Mon Jul 2 13:09:28 2012 New Revision: 238800 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238800 Log: r238613@FreeBSD-dev: root | 2012-06-29 14:39:44 -0500 Properly check return values for pthread_mutex_lock() and pthread_mutex_unlock(). Modified: soc2012/gmiller/locking-head/ (props changed) soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Modified: soc2012/gmiller/locking-head/lib/libwitness/wrappers.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Mon Jul 2 12:12:16 2012 (r238799) +++ soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Mon Jul 2 13:09:28 2012 (r238800) @@ -38,7 +38,7 @@ int ret; ret = _pthread_mutex_lock(mutex); - if (mutex != &witness_mtx) { + if (mutex != &witness_mtx && ret == 0) { add_lock(mutex); } @@ -51,7 +51,7 @@ int ret; ret = _pthread_mutex_unlock(mutex); - if (mutex != &witness_mtx) { + if (mutex != &witness_mtx && ret == 0) { remove_lock(mutex); }