Browse Source

Bugfix: Also hold the console lock when writing to stderr

Luke Dashjr 12 years ago
parent
commit
dcfbb7b2cf
1 changed files with 2 additions and 0 deletions
  1. 2 0
      logging.c

+ 2 - 0
logging.c

@@ -88,8 +88,10 @@ void _applog(int prio, const char *str)
 
 		/* Only output to stderr if it's not going to the screen as well */
 		if (writetofile) {
+			bfg_console_lock();
 			fprintf(stderr, " %s %s\n", datetime, str);	/* atomic write to stderr */
 			fflush(stderr);
+			bfg_console_unlock();
 		}
 
 		if (writetocon)