Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sysmon If previously there was only a dummy event en...



details:   https://anonhg.NetBSD.org/src/rev/e54c037094b6
branches:  trunk
changeset: 780293:e54c037094b6
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Jul 19 13:30:01 2012 +0000

description:
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.

diffstat:

 sys/dev/sysmon/sysmon_envsys_events.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 1f322c436399 -r e54c037094b6 sys/dev/sysmon/sysmon_envsys_events.c
--- a/sys/dev/sysmon/sysmon_envsys_events.c     Thu Jul 19 12:39:08 2012 +0000
+++ b/sys/dev/sysmon/sysmon_envsys_events.c     Thu Jul 19 13:30:01 2012 +0000
@@ -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 @@
        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 @@
                                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) {



Home | Main Index | Thread Index | Old Index