diff options
author | Sergey Alirzaev <zl29ah@gmail.com> | 2015-05-30 12:13:56 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2015-07-01 08:09:53 -0500 |
commit | 4a937b96aa883034adb6f216c2e212a4611c503b (patch) | |
tree | 1de7a4b2b3084f31d5e70bc3d1ac91c5644402ee /src | |
parent | fceb5a41c25a622755ce6235091354d044de769a (diff) | |
download | ofono-4a937b96aa883034adb6f216c2e212a4611c503b.tar.bz2 |
build: make ofono build against musl
ifdef away GNU libc extensions and use a POSIXly correct pointer type
Diffstat (limited to 'src')
-rw-r--r-- | src/log.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -30,7 +30,9 @@ #include <stdlib.h> #include <string.h> #include <syslog.h> +#ifdef __GLIBC__ #include <execinfo.h> +#endif #include <dlfcn.h> #include "ofono.h" @@ -113,6 +115,7 @@ void ofono_debug(const char *format, ...) va_end(ap); } +#ifdef __GLIBC__ static void print_backtrace(unsigned int offset) { void *frames[99]; @@ -240,6 +243,7 @@ static void signal_setup(sighandler_t handler) sigaction(SIGABRT, &sa, NULL); sigaction(SIGPIPE, &sa, NULL); } +#endif extern struct ofono_debug_desc __start___debug[]; extern struct ofono_debug_desc __stop___debug[]; @@ -305,7 +309,9 @@ int __ofono_log_init(const char *program, const char *debug, if (detach == FALSE) option |= LOG_PERROR; +#ifdef __GLIBC__ signal_setup(signal_handler); +#endif openlog(basename(program), option, LOG_DAEMON); @@ -320,7 +326,9 @@ void __ofono_log_cleanup(void) closelog(); +#ifdef __GLIBC__ signal_setup(SIG_DFL); +#endif g_strfreev(enabled); } |