2012-05-29 09:48:00 +02:00
|
|
|
[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.
|
|
|
|
|
2015-10-30 19:49:45 +01:00
|
|
|
NOTE: based on patch from Peter Korsgaard <jacmet@sunsite.dk>
|
2012-05-29 09:48:00 +02:00
|
|
|
|
2015-10-30 19:49:45 +01:00
|
|
|
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
|
|
---
|
|
|
|
--- ofono-1.7.orig/src/log.c
|
|
|
|
+++ ofono-1.7/src/log.c
|
|
|
|
@@ -30,7 +30,8 @@
|
2012-05-29 09:48:00 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <syslog.h>
|
2015-10-30 19:49:45 +01:00
|
|
|
-#ifdef __GLIBC__
|
|
|
|
+#if defined(__GLIBC__) && !(defined(__UCLIBC__) && !defined (__UCLIBC_HAS_BACKTRACE__))
|
2012-05-29 09:48:00 +02:00
|
|
|
+#define HAVE_BACKTRACE
|
|
|
|
#include <execinfo.h>
|
2015-10-30 19:49:45 +01:00
|
|
|
#endif
|
2012-05-29 09:48:00 +02:00
|
|
|
#include <dlfcn.h>
|
2015-10-30 19:49:45 +01:00
|
|
|
@@ -115,7 +116,7 @@
|
|
|
|
va_end(ap);
|
|
|
|
}
|
2012-05-29 09:48:00 +02:00
|
|
|
|
2015-10-30 19:49:45 +01:00
|
|
|
-#ifdef __GLIBC__
|
|
|
|
+#ifdef HAVE_BACKTRACE
|
2012-05-29 09:48:00 +02:00
|
|
|
static void print_backtrace(unsigned int offset)
|
|
|
|
{
|
|
|
|
void *frames[99];
|
2015-10-30 19:49:45 +01:00
|
|
|
@@ -309,7 +310,7 @@
|
|
|
|
if (detach == FALSE)
|
|
|
|
option |= LOG_PERROR;
|
2012-05-29 09:48:00 +02:00
|
|
|
|
2015-10-30 19:49:45 +01:00
|
|
|
-#ifdef __GLIBC__
|
|
|
|
+#ifdef HAVE_BACKTRACE
|
|
|
|
signal_setup(signal_handler);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@@ -326,7 +327,7 @@
|
|
|
|
|
|
|
|
closelog();
|
|
|
|
|
|
|
|
-#ifdef __GLIBC__
|
|
|
|
+#ifdef HAVE_BACKTRACE
|
|
|
|
signal_setup(SIG_DFL);
|
|
|
|
#endif
|
2012-05-29 09:48:00 +02:00
|
|
|
|