X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsmart.c;h=3b113bd33a2d45978622fc0512efe3e11f7eec38;hb=4ea7aebc3f05d082f64a62c679f414cf7cb0e631;hp=f0c189e9e01422de492dc9de9468968df47f3882;hpb=394a4b4a8f9ecb180a4356c59c13df61b5f9f357;p=collectd.git diff --git a/src/smart.c b/src/smart.c index f0c189e9..7b39aaee 100644 --- a/src/smart.c +++ b/src/smart.c @@ -68,7 +68,8 @@ static int smart_config (const char *key, const char *value) return (0); } /* int smart_config */ -static void smart_submit (const char *dev, char *type, char *type_inst, double value) +static void smart_submit (const char *dev, const char *type, + const char *type_inst, double value) { value_t values[1]; value_list_t vl = VALUE_LIST_INIT; @@ -109,7 +110,7 @@ static void smart_handle_disk_attribute(SkDisk *d, const SkSmartAttributeParsedD plugin_dispatch_values (&vl); - if (a->threshold_valid && a->current_value < a->threshold) + if (a->threshold_valid && a->current_value <= a->threshold) { notification_t notif = { NOTIF_WARNING, cdtime (), @@ -253,6 +254,7 @@ static int smart_read (void) /* Query status with libatasmart */ smart_handle_disk (devpath); + udev_device_unref (dev); } udev_enumerate_unref (enumerate);