X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fntpd.c;h=bc81cdd8ad47f059748d4b3e239e69e28e66450a;hb=ca89ee257db233a0512c73b6d8353b1aa86e3e8a;hp=1cb59dee56db698165b0221660e670b5b7d15284;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/ntpd.c b/src/ntpd.c index 1cb59dee..bc81cdd8 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -292,16 +292,11 @@ static int ntpd_config(const char *key, const char *value) { static void ntpd_submit(const char *type, const char *type_inst, 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, "ntpd", sizeof(vl.plugin)); - sstrncpy(vl.plugin_instance, "", sizeof(vl.plugin_instance)); sstrncpy(vl.type, type, sizeof(vl.type)); sstrncpy(vl.type_instance, type_inst, sizeof(vl.type_instance)); @@ -855,9 +850,9 @@ static int ntpd_read(void) { } /* kerninfo -> estimated error */ - offset_loop = scale_loop * ((gauge_t)ntohl(ik->offset)); + offset_loop = (gauge_t)((int32_t)ntohl(ik->offset) * scale_loop); freq_loop = ntpd_read_fp(ik->freq); - offset_error = scale_error * ((gauge_t)ntohl(ik->esterror)); + offset_error = (gauge_t)((int32_t)ntohl(ik->esterror) * scale_error); DEBUG("info_kernel:\n" " pll offset = %.8g\n"