Merge branch 'collectd-5.7' into collectd-5.8
[collectd.git] / src / users.c
index 1ae128e..6bc7cc3 100644 (file)
 #endif
 
 static void users_submit(gauge_t value) {
-  value_t values[1];
   value_list_t vl = VALUE_LIST_INIT;
 
-  values[0].gauge = value;
-
-  vl.values = values;
+  vl.values = &(value_t){.gauge = value};
   vl.values_len = 1;
-  sstrncpy(vl.host, hostname_g, sizeof(vl.host));
   sstrncpy(vl.plugin, "users", sizeof(vl.plugin));
   sstrncpy(vl.type, "users", sizeof(vl.plugin));
 
@@ -105,7 +101,7 @@ static int users_read(void) {
   us = sg_get_user_stats();
 #endif
   if (us == NULL)
-    return (-1);
+    return -1;
 
   users_submit((gauge_t)
 #if HAVE_LIBSTATGRAB_0_90
@@ -119,7 +115,7 @@ static int users_read(void) {
 #error "No applicable input method."
 #endif
 
-  return (0);
+  return 0;
 } /* int users_read */
 
 void module_register(void) {