Skip to content

Commit

Permalink
Revert change to report interval logic
Browse files Browse the repository at this point in the history
75acb36 changed the `else` block to an `else if` at line 418 which caused the `pthread_cond_wait` call to fall outside of the block.

This commit restores the else so `pthread_cond_wait` falls within the else and is only called when reporting is disabled.
  • Loading branch information
jw3 committed Nov 26, 2024
1 parent f76484b commit 38b2242
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/daemon/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,17 @@ static void *decision_thread_main(void *arg)
pthread_cond_timedwait(&do_decision,
&decision_lock,
&rpt_timeout);
} else if (run_stats) {
rpt_write();
run_stats = 0;
} else {
if (run_stats) {
rpt_write();
run_stats = 0;
}
if (stop)
break;

// no interval reports, await a fan event indefinitely
pthread_cond_wait(&do_decision, &decision_lock);
}
// no interval reports, await a fan event indefinitely
if (stop)
break;
pthread_cond_wait(&do_decision, &decision_lock);
}

if (stop) {
Expand Down

0 comments on commit 38b2242

Please sign in to comment.