aboutsummaryrefslogtreecommitdiff
path: root/lib/libstand
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-03-30 19:07:41 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-03-30 19:07:41 +0000
commite95be33a5ef04eba04a3a4478e79be4f77dc485e (patch)
treefb90396bf2495e80a99252ac20664c1beb8972a3 /lib/libstand
parent7e3d78ae6dc7f21f62d0a343ac0d6bc74af6cbe3 (diff)
downloadsrc-e95be33a5ef04eba04a3a4478e79be4f77dc485e.tar.gz
src-e95be33a5ef04eba04a3a4478e79be4f77dc485e.zip
Use panic() (which the environment is required to provide to libstand) to
implement assert() instead of relying on a non-required exit(). The exit() invocation also did not match the semantics of the exit() routine that current boot environments happen to require. PR: kern/144749 Discussed with: bde MFC after: 1 week
Notes
Notes: svn path=/head/; revision=205900
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/assert.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libstand/assert.c b/lib/libstand/assert.c
index b42435824ae8..8eec63a4729a 100644
--- a/lib/libstand/assert.c
+++ b/lib/libstand/assert.c
@@ -35,10 +35,10 @@ void
__assert(const char *func, const char *file, int line, const char *expression)
{
if (func == NULL)
- printf("Assertion failed: (%s), file %s, line %d.\n",
+ panic("Assertion failed: (%s), file %s, line %d.\n",
expression, file, line);
else
- printf("Assertion failed: (%s), function %s, file %s, line "
- "%d.\n", expression, func, file, line);
- exit();
+ panic(
+ "Assertion failed: (%s), function %s, file %s, line %d.\n",
+ expression, func, file, line);
}