DEVELOPERS: add Yegor Yefremov for the ser2net package
[buildroot-gz.git] / package / netplug / 0003-remove-assert-fail.patch
blob635c462a5eec42060c5956ed539001b4f4733bb1
1 Remove __assert_fail()
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.
9 This attempt:
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
13 useless.
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
22 glibc anyway).
24 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
26 Index: b/lib.c
27 ===================================================================
28 --- a/lib.c
29 +++ b/lib.c
30 @@ -199,21 +199,6 @@
31 return x;
35 -void
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",
40 - file, line,
41 - function ? function : "",
42 - function ? ": " : "",
43 - assertion);
45 - abort();
50 * Local variables:
51 * c-file-style: "stroustrup"