summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2000-09-07 19:21:30 +0000
committerart <art@openbsd.org>2000-09-07 19:21:30 +0000
commit1c2368797a8e814515c7f2ad316d9ca323d57f67 (patch)
tree748f6014f6d9e9f40e1f6f9393a174cb6bba5a9b
parentPut powerhooks on a CIRCLEQ instead of LIST. (diff)
downloadwireguard-openbsd-1c2368797a8e814515c7f2ad316d9ca323d57f67.tar.xz
wireguard-openbsd-1c2368797a8e814515c7f2ad316d9ca323d57f67.zip
On resume run the powerhook in installation order.
(the powerhooks were always run in reverse order).
-rw-r--r--sys/kern/kern_subr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index a26346a3ef2..59550ac7940 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_subr.c,v 1.15 2000/09/07 19:07:00 art Exp $ */
+/* $OpenBSD: kern_subr.c,v 1.16 2000/09/07 19:21:30 art Exp $ */
/* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */
/*
@@ -319,8 +319,14 @@ dopowerhooks(why)
int s;
s = splhigh();
- CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list) {
- (*dp->sfd_fn)(why, dp->sfd_arg);
+ if (why == PWR_RESUME) {
+ CIRCLEQ_FOREACH_REVERSE(dp, &powerhook_list, sfd_list) {
+ (*dp->sfd_fn)(why, dp->sfd_arg);
+ }
+ } else {
+ CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list) {
+ (*dp->sfd_fn)(why, dp->sfd_arg);
+ }
}
splx(s);
}