3 The netplug code uses the assert() macro in various places. In glibc
4 internally, assert() uses a function called __assert_fail() to print a
5 message and abort. Relying on internal glibc details, netplug
6 re-defines __assert_fail() in the hope that it will get called instead
7 of glibc internal version.
11 * Doesn't work with uClibc, which doesn't use any __assert_fail()
12 function at all. It doesn't fail to build, but it is entirely
15 * Fails to build with musl, which also defines __assert_fail(), but
16 with a different prototype.
18 We simply remove the __assert_fail() implementation, so that the C
19 library implementation of assert() just does its normal work. The only
20 functionality lost is that the message is displayed on the standard
21 output rather than in netplug's logs (and this was only working with
24 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
27 ===================================================================
36 -__assert_fail(const char *assertion, const char *file,
37 - unsigned int line, const char *function)
39 - do_log(LOG_CRIT, "%s:%u: %s%sAssertion `%s' failed",
41 - function ? function : "",
42 - function ? ": " : "",
51 * c-file-style: "stroustrup"