All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] configure.ac: rewrite support for backtrace detection
@ 2015-11-06 17:34 Petr Vorel
  2015-11-06 17:34 ` [PATCH 2/2] don't redefine GNU_SOURCE Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2015-11-06 17:34 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 configure.ac | 4 ++++
 src/log.c    | 8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index b8d42c8..b6183a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -245,3 +245,7 @@ AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}",
 
 AC_OUTPUT(Makefile include/version.h src/ofono.service ofono.pc \
 		dundee/dundee.service)
+
+dnl Check for backtrace() support
+AC_CHECK_HEADERS(execinfo.h)
+AC_CHECK_FUNCS(backtrace)
diff --git a/src/log.c b/src/log.c
index 6331b0d..0d55d6e 100644
--- a/src/log.c
+++ b/src/log.c
@@ -30,7 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
-#ifdef __GLIBC__
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
 #endif
 #include <dlfcn.h>
@@ -115,7 +115,7 @@ void ofono_debug(const char *format, ...)
 	va_end(ap);
 }
 
-#ifdef __GLIBC__
+#ifdef HAVE_BACKTRACE
 static void print_backtrace(unsigned int offset)
 {
 	void *frames[99];
@@ -309,7 +309,7 @@ int __ofono_log_init(const char *program, const char *debug,
 	if (detach == FALSE)
 		option |= LOG_PERROR;
 
-#ifdef __GLIBC__
+#ifdef HAVE_BACKTRACE
 	signal_setup(signal_handler);
 #endif
 
@@ -326,7 +326,7 @@ void __ofono_log_cleanup(void)
 
 	closelog();
 
-#ifdef __GLIBC__
+#ifdef HAVE_BACKTRACE
 	signal_setup(SIG_DFL);
 #endif
 
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-13 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-06 17:34 [PATCH 1/2] configure.ac: rewrite support for backtrace detection Petr Vorel
2015-11-06 17:34 ` [PATCH 2/2] don't redefine GNU_SOURCE Petr Vorel
2015-11-06 23:23   ` Marcel Holtmann
2015-11-13 23:05     ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.