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