From: Andrew Bays Date: Mon, 5 Nov 2018 15:17:20 +0000 (-0500) Subject: More styling + ignorelist create check X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=ca29e0c9848a757fbd316ade5ff6709edfb7bd22 More styling + ignorelist create check --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index f486efa6..e433cf62 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -1613,11 +1613,6 @@ LoadPlugin connectivity interface(s) to monitor connect to. -=item I - -If I is greater than or equal to zero the message indicates interface is up, -if I is less than zero the message indicates interface is down. - =back =head2 Plugin C diff --git a/src/connectivity.c b/src/connectivity.c index c470c995..f9edece1 100644 --- a/src/connectivity.c +++ b/src/connectivity.c @@ -558,8 +558,7 @@ static int read_event(int nl, int (*msg_handler)(struct nlmsghdr *)) { continue; } - if (errno == EINTR) - { + if (errno == EINTR) { // Interrupt, so just return return 0; } @@ -614,13 +613,9 @@ static void send_interface_status() { for (interface_list_t *il = interface_list_head; il != NULL; il = il->next) /* {{{ */ { - uint32_t status; - uint32_t prev_status; - uint32_t sent; - - status = il->status; - prev_status = il->prev_status; - sent = il->sent; + uint32_t status = il->status; + uint32_t prev_status = il->prev_status; + uint32_t sent = il->sent; if (status != prev_status && sent == 0) { connectivity_dispatch_notification(il->interface, "gauge", status, @@ -945,6 +940,9 @@ static int connectivity_config(const char *key, const char *value) /* {{{ */ { if (ignorelist == NULL) { ignorelist = ignorelist_create(/* invert = */ 1); + + if (ignorelist == NULL) + return -1; } if (strcasecmp(key, "Interface") == 0) {