summaryrefslogtreecommitdiff
path: root/sys/dev/sysmon
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2009-12-23 18:31:00 +0000
committerpgoyette <pgoyette@NetBSD.org>2009-12-23 18:31:00 +0000
commit160a805c1d2a91c8afeea0d81774b33b40fc8127 (patch)
tree7340eeb0d26eeeaa8f78bd031e2f253452763123 /sys/dev/sysmon
parente24ad332eca5557f63981ac7b8926d80c15e3ff2 (diff)
Check for value exceeding crit-max limit before checking against warn-max
limit. Otherwise we'll never notice if we exceed crit-max (assuming that crit-max is at least as large as warn-max).
Diffstat (limited to 'sys/dev/sysmon')
-rw-r--r--sys/dev/sysmon/sysmon_envsys_events.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/sysmon/sysmon_envsys_events.c b/sys/dev/sysmon/sysmon_envsys_events.c
index 28c4f95dce5..4a7310e1069 100644
--- a/sys/dev/sysmon/sysmon_envsys_events.c
+++ b/sys/dev/sysmon/sysmon_envsys_events.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.71 2009/07/10 15:27:33 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.72 2009/12/23 18:31:00 pgoyette Exp $ */
/*-
* Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.71 2009/07/10 15:27:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.72 2009/12/23 18:31:00 pgoyette Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -671,10 +671,10 @@ sme_events_worker(struct work *wk, void *arg)
else if __EXCEED_LIM(PROP_WARNMIN | PROP_BATTWARN,
sel_warnmin, <)
edata->state = ENVSYS_SWARNUNDER;
- else if __EXCEED_LIM(PROP_WARNMAX, sel_warnmax, >)
- edata->state = ENVSYS_SWARNOVER;
else if __EXCEED_LIM(PROP_CRITMAX, sel_critmax, >)
edata->state = ENVSYS_SCRITOVER;
+ else if __EXCEED_LIM(PROP_WARNMAX, sel_warnmax, >)
+ edata->state = ENVSYS_SWARNOVER;
}
#undef __EXCEED_LIM