From cee3df1e4b1b8103bf81e5281a46aab7881f93df Mon Sep 17 00:00:00 2001 From: ajs Date: Wed, 24 Nov 2004 17:14:49 +0000 Subject: 2004-11-24 Andrew J. Schorr * zassert.h: New header file to declare a quagga-specific assert macro. * log.c: (_zlog_assert_failed) New function called when assert fails to log the error and abort. * zebra.h: Include "zassert.h" instead of . * regex.c: Include "zassert.h" instead of . * dict.c: Include "zassert.h" instead of . --- lib/log.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/log.c') diff --git a/lib/log.c b/lib/log.c index c55bfcb1..38f8ecea 100644 --- a/lib/log.c +++ b/lib/log.c @@ -315,6 +315,15 @@ PLOG_FUNC(plog_debug, LOG_DEBUG) #undef PLOG_FUNC +void +_zlog_assert_failed (const char *assertion, const char *file, + unsigned int line, const char *function) +{ + zlog_err("Assertion `%s' failed in file %s, line %u, function %s", + assertion,file,line,(function ? function : "?")); + abort(); +} + /* Open log stream */ struct zlog * -- cgit v1.2.3