buildroot/package/ofono/0001-uclibc-backtrace.patch
Peter Korsgaard 298cd8eaa2 package/*: rename patches according to the new policy
Autogenerated from rename-patch.py (http://patchwork.ozlabs.org/patch/403345)

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-02-03 14:52:56 +01:00

45 lines
1 KiB
Diff

[PATCH] fix build on uClibc without UCLIBC_HAS_BACKTRACE
Backtrace support is only used for logging on signal errors, which
isn't really critical, so simply remove backtrace info if not
available in uClibc.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
src/log.c | 7 +++++++
1 file changed, 7 insertions(+)
Index: ofono-1.5/src/log.c
===================================================================
--- ofono-1.5.orig/src/log.c
+++ ofono-1.5/src/log.c
@@ -30,7 +30,12 @@
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
+#include <features.h>
+/* backtrace support is optional on uClibc */
+#if !(defined(__UCLIBC__) && !defined (__UCLIBC_HAS_BACKTRACE__))
+#define HAVE_BACKTRACE
#include <execinfo.h>
+#endif
#include <dlfcn.h>
#include "ofono.h"
@@ -115,6 +120,7 @@
static void print_backtrace(unsigned int offset)
{
+#ifdef HAVE_BACKTRACE
void *frames[99];
size_t n_ptrs;
unsigned int i;
@@ -213,6 +219,7 @@
close(outfd[1]);
close(infd[0]);
+#endif /* HAVE_BACKTRACE */
}
static void signal_handler(int signo)