summaryrefslogtreecommitdiffstats
path: root/lib/log.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-03-16 11:03:44 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2021-05-02 16:27:17 +0200
commit64dd77361f7ab97365d264408afb538097c0339c (patch)
treefb9350dd6f43fae80b8d3e67cbb285901f42e125 /lib/log.c
parent*: remaining zassert => assert (diff)
downloadfrr-64dd77361f7ab97365d264408afb538097c0339c.tar.xz
frr-64dd77361f7ab97365d264408afb538097c0339c.zip
lib: rework how we "override" assert()
The previous method, using zassert.h and hoping nothing includes assert.h (which, on glibc at least, just does "#undef assert" and puts its own definition in...) was fragile - and actually broke undetected. Just provide our own assert.h and control overriding by putting it in a separate directory to add to the include path (or not.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/log.c b/lib/log.c
index ca2f50168..15fdfd4b0 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -311,17 +311,6 @@ void zlog_thread_info(int log_level)
zlog(log_level, "Current thread not known/applicable");
}
-void _zlog_assert_failed(const char *assertion, const char *file,
- unsigned int line, const char *function)
-{
- zlog(LOG_CRIT, "Assertion `%s' failed in file %s, line %u, function %s",
- assertion, file, line, (function ? function : "?"));
- zlog_backtrace(LOG_CRIT);
- zlog_thread_info(LOG_CRIT);
- log_memstats(stderr, "log");
- abort();
-}
-
void memory_oom(size_t size, const char *name)
{
zlog(LOG_CRIT,