X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fserial.c;h=9bd885dbbf0bec28aeacbe8ae06624a06bf0a98e;hb=HEAD;hp=9cfe1dd471b6ee1e195781617512a4ee16dd5d05;hpb=90ac9957e95378d729bce1c00bb0ef2efadab33e;p=collectd.git diff --git a/src/serial.c b/src/serial.c index 9cfe1dd4..9bd885db 100644 --- a/src/serial.c +++ b/src/serial.c @@ -30,23 +30,23 @@ #endif static void serial_submit (const char *type_instance, - counter_t rx, counter_t tx) + derive_t rx, derive_t tx) { value_t values[2]; value_list_t vl = VALUE_LIST_INIT; - values[0].counter = rx; - values[1].counter = tx; + values[0].derive = rx; + values[1].derive = tx; vl.values = values; vl.values_len = 2; - vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "serial"); - strncpy (vl.type_instance, type_instance, + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "serial", sizeof (vl.plugin)); + sstrncpy (vl.type, "serial_octets", sizeof (vl.type)); + sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); - plugin_dispatch_values ("serial_octets", &vl); + plugin_dispatch_values (&vl); } static int serial_read (void) @@ -54,8 +54,8 @@ static int serial_read (void) FILE *fh; char buffer[1024]; - counter_t rx = 0; - counter_t tx = 0; + derive_t rx = 0; + derive_t tx = 0; char *fields[16]; int i, numfields;