Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sysmon In sysmon_envsys_sensor_event(), permit deliv...
details: https://anonhg.NetBSD.org/src/rev/1ae785bdb665
branches: trunk
changeset: 753372:1ae785bdb665
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Mar 24 13:11:41 2010 +0000
description:
In sysmon_envsys_sensor_event(), permit delivery of all events for the
sensor if no event type is specified.
diffstat:
sys/dev/sysmon/sysmon_envsys_events.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diffs (48 lines):
diff -r 0c8bf9bc1f80 -r 1ae785bdb665 sys/dev/sysmon/sysmon_envsys_events.c
--- a/sys/dev/sysmon/sysmon_envsys_events.c Wed Mar 24 12:56:30 2010 +0000
+++ b/sys/dev/sysmon/sysmon_envsys_events.c Wed Mar 24 13:11:41 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.88 2010/03/23 16:52:02 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.89 2010/03/24 13:11:41 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.88 2010/03/23 16:52:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.89 2010/03/24 13:11:41 pgoyette Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -646,7 +646,8 @@
* sysmon_envsys_sensor_event
*
* + Find the monitor event of a particular type for a given sensor
- * on a device and deliver the event if one is required.
+ * on a device and deliver the event if one is required. If
+ * no event type is specified, deliver all events for the sensor.
*/
void
sysmon_envsys_sensor_event(struct sysmon_envsys *sme, envsys_data_t *edata,
@@ -656,11 +657,14 @@
mutex_enter(&sme->sme_mtx);
LIST_FOREACH(see, &sme->sme_events_list, see_list) {
- if (edata != see->see_edata ||
- see->see_type != ev_type)
- continue;
- sme_deliver_event(see);
- break;
+ if (edata != see->see_edata)
+ continue;
+ if (ev_type == 0 ||
+ ev_type == see->see_type) {
+ sme_deliver_event(see);
+ if (ev_type != 0)
+ break;
+ }
}
mutex_exit(&sme->sme_mtx);
}
Home |
Main Index |
Thread Index |
Old Index