X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flogfile.c;h=0de639e966704200232514ede2f8ea277059fad8;hb=464c89681dae3bdf9b30470469161da6ac5aeb37;hp=e51c9db9f3a3f50144a7635a29871c6bc638495d;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/logfile.c b/src/logfile.c index e51c9db9..0de639e9 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -80,7 +80,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] = ""; @@ -107,8 +106,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); @@ -209,5 +208,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 : */