X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flogfile.c;h=6d555842f787dda0c687c0a08d2cf4657cd6aba3;hb=0a8741b9061f8df4a78a448c021612db06e17425;hp=d18a5365556a67f9cd0be54595d3cfa3d0883588;hpb=063a5e75b36173e89ffa18d32d47509f6ef968ec;p=collectd.git diff --git a/src/logfile.c b/src/logfile.c index d18a5365..6d555842 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -90,7 +90,6 @@ static void logfile_print (const char *msg, int severity, { FILE *fh; _Bool do_close = 0; - struct tm timestamp_tm; char timestamp_str[64]; char level_str[16] = ""; @@ -120,8 +119,8 @@ static void logfile_print (const char *msg, int severity, if (print_timestamp) { - time_t tt = CDTIME_T_TO_TIME_T (timestamp_time); - localtime_r (&tt, ×tamp_tm); + struct tm timestamp_tm; + localtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), ×tamp_tm); strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S", ×tamp_tm);