Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sysmon When removing properties (as in envstat -S), ...
details: https://anonhg.NetBSD.org/src/rev/a5c565810eee
branches: trunk
changeset: 759385:a5c565810eee
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Dec 08 00:09:14 2010 +0000
description:
When removing properties (as in envstat -S), clear the flags that track
whether the properties actually exist.
When setting new limit values, don't complain/ignore about duplicate
values if the associated flag bits (indicating that the limit is valid)
are not set.
These two fixes together should fix a problem reported in private Email
by njoly@ a couple months ago. Issue replicated and solution tested
using my recent swsensor pseudo-device running inside qemu world!
diffstat:
sys/dev/sysmon/sysmon_envsys.c | 10 ++++++----
sys/dev/sysmon/sysmon_envsys_events.c | 15 +++++++--------
2 files changed, 13 insertions(+), 12 deletions(-)
diffs (84 lines):
diff -r cafcb40330f7 -r a5c565810eee sys/dev/sysmon/sysmon_envsys.c
--- a/sys/dev/sysmon/sysmon_envsys.c Tue Dec 07 23:29:55 2010 +0000
+++ b/sys/dev/sysmon/sysmon_envsys.c Wed Dec 08 00:09:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys.c,v 1.107 2010/04/11 01:12:28 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys.c,v 1.108 2010/12/08 00:09:14 pgoyette Exp $ */
/*-
* Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.107 2010/04/11 01:12:28 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.108 2010/12/08 00:09:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -1143,8 +1143,10 @@
lims = edata->limits;
(*sme->sme_get_limits)(sme, edata, &lims,
&edata->upropset);
- }
- if (edata->upropset) {
+ } else
+ edata->upropset &= ~PROP_LIMITS;
+
+ if (edata->upropset & PROP_LIMITS) {
DPRINTF(("%s: install limits for %s %s\n",
__func__, sme->sme_name, edata->desc));
sme_update_limits(sme, edata);
diff -r cafcb40330f7 -r a5c565810eee sys/dev/sysmon/sysmon_envsys_events.c
--- a/sys/dev/sysmon/sysmon_envsys_events.c Tue Dec 07 23:29:55 2010 +0000
+++ b/sys/dev/sysmon/sysmon_envsys_events.c Wed Dec 08 00:09:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.94 2010/12/06 23:26:44 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.95 2010/12/08 00:09:14 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.94 2010/12/06 23:26:44 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.95 2010/12/08 00:09:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -151,29 +151,28 @@
__func__, sme->sme_name, edata->desc, crittype));
see = osee;
- if (props & (PROP_CRITMAX | PROP_BATTMAX)) {
+ if (props & edata->upropset & (PROP_CRITMAX | PROP_BATTMAX)) {
if (lims->sel_critmax == edata->limits.sel_critmax) {
- DPRINTF(("%s: type=%d (critmax exists)\n",
- __func__, crittype));
+ DPRINTF(("%s: critmax exists\n", __func__));
error = EEXIST;
props &= ~(PROP_CRITMAX | PROP_BATTMAX);
}
}
- if (props & (PROP_WARNMAX | PROP_BATTHIGH)) {
+ if (props & edata->upropset & (PROP_WARNMAX | PROP_BATTHIGH)) {
if (lims->sel_warnmax == edata->limits.sel_warnmax) {
DPRINTF(("%s: warnmax exists\n", __func__));
error = EEXIST;
props &= ~(PROP_WARNMAX | PROP_BATTHIGH);
}
}
- if (props & (PROP_WARNMIN | PROP_BATTWARN)) {
+ if (props & edata->upropset & (PROP_WARNMIN | PROP_BATTWARN)) {
if (lims->sel_warnmin == edata->limits.sel_warnmin) {
DPRINTF(("%s: warnmin exists\n", __func__));
error = EEXIST;
props &= ~(PROP_WARNMIN | PROP_BATTWARN);
}
}
- if (props & (PROP_CRITMIN | PROP_BATTCAP)) {
+ if (props & edata->upropset & (PROP_CRITMIN | PROP_BATTCAP)) {
if (lims->sel_critmin == edata->limits.sel_critmin) {
DPRINTF(("%s: critmin exists\n", __func__));
error = EEXIST;
Home |
Main Index |
Thread Index |
Old Index