summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-05-20 22:16:36 +0000
committerart <art@openbsd.org>2002-05-20 22:16:36 +0000
commit5f651d6b2b7acdd479edfc0a204465f21afebfc0 (patch)
tree1e931b00282b44ea1f56ff4a5d24941daa82d0cd
parentupdate user list; spotted by hshoexer@yerbouti.franken.de (diff)
downloadwireguard-openbsd-5f651d6b2b7acdd479edfc0a204465f21afebfc0.tar.xz
wireguard-openbsd-5f651d6b2b7acdd479edfc0a204465f21afebfc0.zip
Add one more level to the kern.splassert sysctl.
0 - do nothing. 1 - small message on error (function name and the levels). 2 - big message on error (function name, levels and traceback (if possible)). 3 - panic. After suggestion from deraadt@.
-rw-r--r--sys/kern/subr_prf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index c417e06e494..cb4f83203ec 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_prf.c,v 1.43 2002/05/18 18:33:42 art Exp $ */
+/* $OpenBSD: subr_prf.c,v 1.44 2002/05/20 22:16:36 art Exp $ */
/* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */
/*-
@@ -234,12 +234,16 @@ splassert_fail(int wantipl, int haveipl, const char *func)
{
printf("splassert: %s: want %d have %d\n", func, wantipl, haveipl);
- if (splassert_ctl > 1) {
- panic("spl assertion failure in %s", func);
- } else {
+ switch (splassert_ctl) {
+ case 1:
+ break;
+ case 2:
#ifdef DDB
db_stack_dump();
#endif
+ break;
+ default:
+ panic("spl assertion failure in %s", func);
}
}