summaryrefslogtreecommitdiff
path: root/main/utils.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-03-17 22:06:44 +0000
committerMark Michelson <mmichelson@digium.com>2008-03-17 22:06:44 +0000
commitb246e010d5d1a3e9498412e50e54ba1588e2a7ca (patch)
tree05ce6f4a3e9a8e2e426097e773cb9675499db3b5 /main/utils.c
parent5e4cd22c0e490ef38f8c9656bb8d077f9eac43e9 (diff)
Merged revisions 109226 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109226 | mmichelson | 2008-03-17 17:05:49 -0500 (Mon, 17 Mar 2008) | 12 lines Fix a logic flaw in the code that stores lock info which is displayed via the "core show locks" command. The idea behind this section of code was to remove the previous lock from the list if it was a trylock that had failed. Unfortunately, instead of checking the status of the previous lock, we were referencing the index immediately following the previous lock in the lock_info->locks array. The result of this problem, under the right circumstances, was that the lock which we currently in the process of attempting to acquire could "overwrite" the previous lock which was acquired. While this does not in any way affect typical operation, it *could* lead to misleading "core show locks" output. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/utils.c')
-rw-r--r--main/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c
index 7325963b7..c3edcd626 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -611,7 +611,7 @@ void ast_store_lock_info(enum ast_lock_type type, const char *filename,
return;
}
- if (i && lock_info->locks[i].pending == -1) {
+ if (i && lock_info->locks[i-1].pending == -1) {
/* The last lock on the list was one that this thread tried to lock but
* failed at doing so. It has now moved on to something else, so remove
* the old lock from the list. */