Date: Wed, 14 Apr 2010 17:17:25 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r206612 - stable/7/lib/libstand Message-ID: <201004141717.o3EHHPdV035583@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Apr 14 17:17:25 2010 New Revision: 206612 URL: http://svn.freebsd.org/changeset/base/206612 Log: MFC 205900: 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. Modified: stable/7/lib/libstand/assert.c Directory Properties: stable/7/lib/libstand/ (props changed) Modified: stable/7/lib/libstand/assert.c ============================================================================== --- stable/7/lib/libstand/assert.c Wed Apr 14 17:17:06 2010 (r206611) +++ stable/7/lib/libstand/assert.c Wed Apr 14 17:17:25 2010 (r206612) @@ -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?201004141717.o3EHHPdV035583>