Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 2010 19:07:42 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r205900 - head/lib/libstand
Message-ID:  <201003301907.o2UJ7g7W067299@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Mar 30 19:07:41 2010
New Revision: 205900
URL: http://svn.freebsd.org/changeset/base/205900

Log:
  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

Modified:
  head/lib/libstand/assert.c

Modified: head/lib/libstand/assert.c
==============================================================================
--- head/lib/libstand/assert.c	Tue Mar 30 19:06:54 2010	(r205899)
+++ head/lib/libstand/assert.c	Tue Mar 30 19:07:41 2010	(r205900)
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003301907.o2UJ7g7W067299>