summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2006-01-05 03:18:47 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2006-01-05 03:18:47 +0000
commitf7fe3ca086fb7214fef0de7f1a29d7db84f1b481 (patch)
tree0f7225025e086585fec075ad9299829ce4e3ab0e
parent498778d14a0fde7e926ede29ac87301493081b5a (diff)
if a kthread fails to call kthread_exit() but instead returns,
bad things happen. fix acct thread. from art
-rw-r--r--sys/kern/kern_acct.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 0cacd38bb11..65b6d9bc114 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_acct.c,v 1.17 2005/11/28 00:14:28 jsg Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.18 2006/01/05 03:18:46 tedu Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
@@ -305,7 +305,7 @@ acct_thread(void *arg)
if (savacctp->v_type == VBAD) {
(void) vn_close(savacctp, FWRITE, NOCRED, p);
savacctp = NULL;
- return;
+ break;
}
(void)VFS_STATFS(savacctp->v_mount, &sb, (struct proc *)0);
if (sb.f_bavail > acctresume * sb.f_blocks / 100) {
@@ -317,7 +317,7 @@ acct_thread(void *arg)
if (acctp->v_type == VBAD) {
(void) vn_close(acctp, FWRITE, NOCRED, p);
acctp = NULL;
- return;
+ break;
}
(void)VFS_STATFS(acctp->v_mount, &sb, (struct proc *)0);
if (sb.f_bavail <= acctsuspend * sb.f_blocks / 100) {
@@ -326,11 +326,12 @@ acct_thread(void *arg)
log(LOG_NOTICE, "Accounting suspended\n");
}
} else {
- acct_proc = NULL;
- kthread_exit(0);
+ break;
}
tsleep(&acct_proc, PPAUSE, "acct", acctchkfreq *hz);
}
+ acct_proc = NULL;
+ kthread_exit(0);
}
void