summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_acct.c14
-rw-r--r--sys/kern/vfs_subr.c6
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index bf64c932e9c..51ed945e3cb 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_acct.c,v 1.13 2003/09/01 18:06:03 henning Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.14 2004/05/27 08:25:53 tedu Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
@@ -73,6 +73,7 @@
comp_t encode_comp_t(u_long, u_long);
int acct_start(void);
void acct_thread(void *);
+void acct_shutdown(void);
/*
* Accounting vnode pointer, and saved vnode pointer.
@@ -334,3 +335,14 @@ acct_thread(void *arg)
tsleep(&acct_proc, PPAUSE, "acct", acctchkfreq *hz);
}
}
+
+void
+acct_shutdown(void)
+{
+
+ if (acctp != NULL || savacctp != NULL) {
+ vn_close((acctp != NULL ? acctp : savacctp), FWRITE,
+ NOCRED, NULL);
+ acctp = savacctp = NULL;
+ }
+}
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index f1b368cd84d..192167e2d87 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.98 2004/04/25 02:48:03 itojun Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.99 2004/05/27 08:25:53 tedu Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1790,11 +1790,15 @@ vfs_unmountall(void)
void
vfs_shutdown()
{
+ extern void acct_shutdown(void);
+
/* XXX Should suspend scheduling. */
(void) spl0();
printf("syncing disks... ");
+ acct_shutdown();
+
if (panicstr == 0) {
/* Sync before unmount, in case we hang on something. */
sys_sync(&proc0, (void *)0, (register_t *)0);