0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-17 11:12:42 +00:00

Remove warning from Coverity ()

* health_nan: fix result

The expression evaluate was keeping the value zero when there was a wrong variable,
but according our documentation the correct result would be NAN, this commit fixes this

* coverity_348642: remove unecessary check

This commit removes an unecessary check for variable in the alarms

* coverity_348642: remove fix

I am removing a change from other commit here
This commit is contained in:
thiagoftsm 2019-10-04 16:51:25 +00:00 committed by GitHub
parent 727c208b5c
commit a0de935378
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -584,21 +584,19 @@ void rrdcalc_unlink_and_free(RRDHOST *host, RRDCALC *rc) {
error("Cannot unlink alarm '%s.%s' from host '%s': not found", rc->chart?rc->chart:"NOCHART", rc->name, host->hostname);
}
if (rc) {
RRDCALC *rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (rdcmp) {
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index from health_log");
}
RRDCALC *rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (rdcmp) {
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index from health_log");
}
}
rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_name, (avl *)rc);
if (rdcmp) {
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_name, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index from idx_name");
}
rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_name, (avl *)rc);
if (rdcmp) {
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_name, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index from idx_name");
}
}