Module Name:    src
Committed By:   pgoyette
Date:           Thu Jul 19 13:30:01 UTC 2012

Modified Files:
        src/sys/dev/sysmon: sysmon_envsys_events.c

Log Message:
If previously there was only a dummy event entry (to force refresh for
entropy gathering), allow it to be updated for the current request to
add a real entry.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/sysmon/sysmon_envsys_events.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.102 src/sys/dev/sysmon/sysmon_envsys_events.c:1.103
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.102	Wed Jul 18 20:50:40 2012
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Thu Jul 19 13:30:01 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.102 2012/07/18 20:50:40 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.103 2012/07/19 13:30:01 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.102 2012/07/18 20:50:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.103 2012/07/19 13:30:01 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -143,7 +143,8 @@ sme_event_register(prop_dictionary_t sdi
 	LIST_FOREACH(osee, &sme->sme_events_list, see_list) {
 		if (strcmp(edata->desc, osee->see_pes.pes_sensname) != 0)
 			continue;
-		if (crittype != osee->see_type)
+		if (crittype != osee->see_type &&
+		    osee->see_type != PENVSYS_EVENT_NULL)
 			continue;
 
 		/*
@@ -184,6 +185,9 @@ sme_event_register(prop_dictionary_t sdi
 				props &= ~(PROP_CRITMIN | PROP_BATTCAP);
 			}
 		}
+		if (props && see->see_type == PENVSYS_EVENT_NULL)
+			see->see_type = crittype;
+
 		break;
 	}
 	if (crittype == PENVSYS_EVENT_NULL && see != NULL) {

Reply via email to