From 2251dd3723c7fa8d9e7b43e485b3805932cec5c2 Mon Sep 17 00:00:00 2001
From: "Kevin P. Fleming" <kpfleming@digium.com>
Date: Tue, 8 Nov 2005 03:54:04 +0000
Subject: [PATCH] issue #5570

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 ChangeLog               | 4 ++++
 include/asterisk/lock.h | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 9981003a5e..b00225a0c0 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-07  Kevin P. Fleming  <kpfleming@digium.com>
+
+	* include/asterisk/lock.h (__ast_pthread_mutex_lock): correct build with DETECT_DEADLOCKS defined (issue #5570)
+
 2005-11-07  Russell Bryant  <russell@digium.com>
 
 	* include/asterisk/app.h: Increment the arg_index in the options structure to fix applicaiton options that have arguments to them
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index edc1126986..9c2df34879 100755
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -235,7 +235,8 @@ static inline int __ast_pthread_mutex_lock(const char *filename, int lineno, con
 					__ast_mutex_logger("%s line %d (%s): Deadlock? waited %d sec for mutex '%s'?\n",
 							   filename, lineno, func, (int)(current - seconds), mutex_name);
 					__ast_mutex_logger("%s line %d (%s): '%s' was locked here.\n",
-							   t->file, t->lineno, t->func, mutex_name);
+							   t->file[t->reentrancy-1], t->lineno[t->reentrancy-1],
+							   t->func[t->reentrancy-1], mutex_name);
 				}
 				usleep(200);
 			}
-- 
GitLab