Merge branch 'collectd-5.7' into collectd-5.8
[collectd.git] / src / log_logstash.c
index 3ef7139..28cc34c 100644 (file)
@@ -79,7 +79,6 @@ static void log_logstash_print(yajl_gen g, int severity,
   struct tm timestamp_tm;
   char timestamp_str[64];
   const unsigned char *buf;
-  time_t tt;
 #if HAVE_YAJL_V2
   size_t len;
 #else
@@ -127,8 +126,7 @@ static void log_logstash_print(yajl_gen g, int severity,
       yajl_gen_status_ok)
     goto err;
 
-  tt = CDTIME_T_TO_TIME_T(timestamp_time);
-  gmtime_r(&tt, &timestamp_tm);
+  gmtime_r(&CDTIME_T_TO_TIME_T(timestamp_time), &timestamp_tm);
 
   /*
    * format time as a UTC ISO 8601 compliant string
@@ -238,7 +236,7 @@ static int log_logstash_notification(const notification_t *n,
 
   if (g == NULL) {
     fprintf(stderr, "Could not allocate JSON generator.\n");
-    return (0);
+    return 0;
   }
 
   if (yajl_gen_map_open(g) != yajl_gen_status_ok)
@@ -325,12 +323,12 @@ static int log_logstash_notification(const notification_t *n,
   }
 
   log_logstash_print(g, LOG_INFO, (n->time != 0) ? n->time : cdtime());
-  return (0);
+  return 0;
 
 err:
   yajl_gen_free(g);
   fprintf(stderr, "Could not correctly generate JSON notification\n");
-  return (0);
+  return 0;
 } /* int log_logstash_notification */
 
 void module_register(void) {
@@ -341,5 +339,3 @@ void module_register(void) {
   plugin_register_notification("log_logstash", log_logstash_notification,
                                /* user_data = */ NULL);
 } /* void module_register (void) */
-
-/* vim: set sw=4 ts=4 tw=78 noexpandtab : */