From 9c345548b52ff0aa77945889ecd70fd3f6064e15 Mon Sep 17 00:00:00 2001 From: Alain Spineux Date: Thu, 17 Aug 2017 11:48:51 +0200 Subject: [PATCH] don't use add_event() when flag "l" is not set - add_event() was called when debug level > 50 without testing for flag "l" - related to #3074 but this is not a fix, this should avoid the problem if flag "l" is not used. --- bacula/src/lib/lockmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bacula/src/lib/lockmgr.c b/bacula/src/lib/lockmgr.c index 094f1e0d58..d53aec863e 100644 --- a/bacula/src/lib/lockmgr.c +++ b/bacula/src/lib/lockmgr.c @@ -433,7 +433,7 @@ public: { int max_prio = max_priority; - if (chk_dbglvl(DBGLEVEL_EVENT) || debug_flags & DEBUG_MUTEX_EVENT) { + if (chk_dbglvl(DBGLEVEL_EVENT) && debug_flags & DEBUG_MUTEX_EVENT) { /* Keep track of this event */ add_event("P()", (intptr_t)m, 0, f, l); } @@ -502,7 +502,7 @@ public: int old_current = current; /* Keep track of this event */ - if (chk_dbglvl(DBGLEVEL_EVENT) || debug_flags & DEBUG_MUTEX_EVENT) { + if (chk_dbglvl(DBGLEVEL_EVENT) && debug_flags & DEBUG_MUTEX_EVENT) { add_event("V()", (intptr_t)m, 0, f, l); } @@ -740,7 +740,7 @@ void *check_deadlock(void *) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old); if (lmgr_detect_deadlock()) { /* If we have information about P()/V(), display them */ - if (debug_flags & DEBUG_MUTEX_EVENT || chk_dbglvl(DBGLEVEL_EVENT)) { + if (debug_flags & DEBUG_MUTEX_EVENT && chk_dbglvl(DBGLEVEL_EVENT)) { debug_flags |= DEBUG_PRINT_EVENT; } lmgr_dump(); -- 2.39.2