X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flogfile.c;h=eca8c34758363507872f33ec13b075019c3575a0;hb=1d429f78567323c11f00e9f6e5ea1765e7c5c8c7;hp=ef3aa97e59b4547fec0aa57992223212bf0071f2;hpb=9cb3abd9449a7f909c3434ec2ff0939939371269;p=collectd.git diff --git a/src/logfile.c b/src/logfile.c index ef3aa97e..eca8c347 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -78,7 +78,6 @@ static void logfile_print(const char *msg, int severity, cdtime_t timestamp_time) { FILE *fh; _Bool do_close = 0; - struct tm timestamp_tm; char timestamp_str[64]; char level_str[16] = ""; @@ -105,8 +104,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); @@ -205,5 +204,3 @@ void module_register(void) { plugin_register_notification("logfile", logfile_notification, /* user_data = */ NULL); } /* void module_register (void) */ - -/* vim: set sw=4 ts=4 tw=78 noexpandtab : */