8499bcfb93132bea5929e845c18182fbf9b5c089
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ofono / 0001-uclibc-backtrace.patch
1 [PATCH] fix build on uClibc without UCLIBC_HAS_BACKTRACE
2
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.
6
7 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
8 ---
9  src/log.c |    7 +++++++
10  1 file changed, 7 insertions(+)
11
12 Index: ofono-1.5/src/log.c
13 ===================================================================
14 --- ofono-1.5.orig/src/log.c
15 +++ ofono-1.5/src/log.c
16 @@ -30,7 +30,12 @@
17  #include <stdlib.h>
18  #include <string.h>
19  #include <syslog.h>
20 +#include <features.h>
21 +/* backtrace support is optional on uClibc */
22 +#if !(defined(__UCLIBC__) && !defined (__UCLIBC_HAS_BACKTRACE__))
23 +#define HAVE_BACKTRACE
24  #include <execinfo.h>
25 +#endif
26  #include <dlfcn.h>
27  
28  #include "ofono.h"
29 @@ -115,6 +120,7 @@
30  
31  static void print_backtrace(unsigned int offset)
32  {
33 +#ifdef HAVE_BACKTRACE
34         void *frames[99];
35         size_t n_ptrs;
36         unsigned int i;
37 @@ -213,6 +219,7 @@
38  
39         close(outfd[1]);
40         close(infd[0]);
41 +#endif /* HAVE_BACKTRACE */
42  }
43  
44  static void signal_handler(int signo)