X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fusers.c;h=6bc7cc34e79f680316862f40b9780b0c010c801b;hp=1ae128e14ca6119b30e3cb881642c28a0e226a43;hb=1159cb5d383c55a80a0db100b8f7aadcf44740a5;hpb=2079ee1517e34de372f58e7e2267ad5c71a8a41f diff --git a/src/users.c b/src/users.c index 1ae128e1..6bc7cc34 100644 --- a/src/users.c +++ b/src/users.c @@ -44,14 +44,10 @@ #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) {