From: Alain Spineux Date: Thu, 17 Aug 2017 09:48:51 +0000 (+0200) Subject: don't use add_event() when flag "l" is not set X-Git-Tag: Release-9.0.4~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9c345548b52ff0aa77945889ecd70fd3f6064e15;p=bacula%2Fbacula 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. --- 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();