package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / ofono / 0001-uclibc-backtrace.patch
blob3ce7bf8cbcbe2ec972fafa8250947501d7ad6205
1 [PATCH] fix build on uClibc without UCLIBC_HAS_BACKTRACE
3 Backtrace support is only used for logging on signal errors, which
4 isn't really critical, so simply remove backtrace info if not
5 available in uClibc.
7 NOTE: based on patch from Peter Korsgaard <jacmet@sunsite.dk>
9 Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
10 ---
11 --- ofono-1.7.orig/src/log.c
12 +++ ofono-1.7/src/log.c
13 @@ -30,7 +30,8 @@
14 #include <stdlib.h>
15 #include <string.h>
16 #include <syslog.h>
17 -#ifdef __GLIBC__
18 +#if defined(__GLIBC__) && !(defined(__UCLIBC__) && !defined (__UCLIBC_HAS_BACKTRACE__))
19 +#define HAVE_BACKTRACE
20 #include <execinfo.h>
21 #endif
22 #include <dlfcn.h>
23 @@ -115,7 +116,7 @@
24 va_end(ap);
27 -#ifdef __GLIBC__
28 +#ifdef HAVE_BACKTRACE
29 static void print_backtrace(unsigned int offset)
31 void *frames[99];
32 @@ -309,7 +310,7 @@
33 if (detach == FALSE)
34 option |= LOG_PERROR;
36 -#ifdef __GLIBC__
37 +#ifdef HAVE_BACKTRACE
38 signal_setup(signal_handler);
39 #endif
41 @@ -326,7 +327,7 @@
43 closelog();
45 -#ifdef __GLIBC__
46 +#ifdef HAVE_BACKTRACE
47 signal_setup(SIG_DFL);
48 #endif