From: Linux Karlsson Date: Fri, 13 Aug 2010 14:54:32 +0000 (+0200) Subject: Minor refactoring to allow redirection of debug messages from unit tests. X-Git-Tag: NTP_4_2_7P43~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e4432adf85b7fb3d75d64af2f9e96cd3cfd4d9e;p=thirdparty%2Fntp.git Minor refactoring to allow redirection of debug messages from unit tests. bk: 4c655ca8O2qeBuifN4caKuTdtnF41A --- diff --git a/sntp/log.c b/sntp/log.c index 69d788135..15ce93e23 100644 --- a/sntp/log.c +++ b/sntp/log.c @@ -6,6 +6,7 @@ int init = 0; int filelog = 0; FILE *log_file; +FILE **debug_log_file = &stderr; void log_msg(char *message, char type) { @@ -40,7 +41,7 @@ void debug_msg(char *message) { time_t cur_time = time(NULL); char *timestamp = ctime(&cur_time); - fprintf(stderr, "%s: %s\n", timestamp, message); + fprintf(*debug_log_file, "%s: %s\n", timestamp, message); } else { syslog(LOG_DEBUG