X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcpusleep.c;h=b5cbe6601c8435fd2e29dc293ed25b86a49eaa1c;hb=6378ec288f34ff250b2971a1452338a2b34c240a;hp=5de0e470bf2c3c1b7bddc1fb465740da2c082ec6;hpb=6f4f918d4d5e70c75471632254ecb9c55fd8d62f;p=collectd.git diff --git a/src/cpusleep.c b/src/cpusleep.c index 5de0e470..b5cbe660 100644 --- a/src/cpusleep.c +++ b/src/cpusleep.c @@ -32,16 +32,15 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include static void cpusleep_submit(derive_t cpu_sleep) { value_list_t vl = VALUE_LIST_INIT; - vl.values = &(value_t) { .derive = cpu_sleep }; + vl.values = &(value_t){.derive = cpu_sleep}; vl.values_len = 1; - sstrncpy(vl.host, hostname_g, sizeof(vl.host)); sstrncpy(vl.plugin, "cpusleep", sizeof(vl.plugin)); sstrncpy(vl.type, "total_time_in_ms", sizeof(vl.type)); @@ -52,12 +51,12 @@ static int cpusleep_read(void) { struct timespec b, m; if (clock_gettime(CLOCK_BOOTTIME, &b) < 0) { ERROR("cpusleep plugin: clock_boottime failed"); - return (-1); + return -1; } if (clock_gettime(CLOCK_MONOTONIC, &m) < 0) { ERROR("cpusleep plugin: clock_monotonic failed"); - return (-1); + return -1; } // to avoid false positives in counter overflow due to reboot, @@ -68,7 +67,7 @@ static int cpusleep_read(void) { cpusleep_submit(sleep); - return (0); + return 0; } void module_register(void) {