Skip to content

Commit

Permalink
SD log: Fix skipped statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzMeier committed Mar 23, 2016
1 parent 2dcd529 commit 1f47aa1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/sdlog2/sdlog2.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,13 @@ void sdlog2_stop_log()
return;
}

logging_enabled = false;

/* disabling the logging will trigger the skipped count to increase,
* so we take a local copy before interrupting the disk I/O.
*/
unsigned long skipped_count = log_msgs_skipped;

logging_enabled = false;

/* wake up write thread one last time */
pthread_mutex_lock(&logbuffer_mutex);
logwriter_should_exit = true;
Expand Down

0 comments on commit 1f47aa1

Please sign in to comment.