mirror of git://git.sysmocom.de/ofono
build: make ofono build against musl
ifdef away GNU libc extensions and use a POSIXly correct pointer type
This commit is contained in:
parent
fceb5a41c2
commit
4a937b96aa
|
@ -67,7 +67,7 @@ gboolean ppp_net_set_mtu(struct ppp_net *net, guint16 mtu)
|
||||||
strncpy(ifr.ifr_name, net->if_name, sizeof(ifr.ifr_name));
|
strncpy(ifr.ifr_name, net->if_name, sizeof(ifr.ifr_name));
|
||||||
ifr.ifr_mtu = mtu;
|
ifr.ifr_mtu = mtu;
|
||||||
|
|
||||||
err = ioctl(sk, SIOCSIFMTU, (caddr_t) &ifr);
|
err = ioctl(sk, SIOCSIFMTU, (void *) &ifr);
|
||||||
|
|
||||||
close(sk);
|
close(sk);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#ifdef __GLIBC__
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
#endif
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
#include "ofono.h"
|
#include "ofono.h"
|
||||||
|
@ -113,6 +115,7 @@ void ofono_debug(const char *format, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GLIBC__
|
||||||
static void print_backtrace(unsigned int offset)
|
static void print_backtrace(unsigned int offset)
|
||||||
{
|
{
|
||||||
void *frames[99];
|
void *frames[99];
|
||||||
|
@ -240,6 +243,7 @@ static void signal_setup(sighandler_t handler)
|
||||||
sigaction(SIGABRT, &sa, NULL);
|
sigaction(SIGABRT, &sa, NULL);
|
||||||
sigaction(SIGPIPE, &sa, NULL);
|
sigaction(SIGPIPE, &sa, NULL);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
extern struct ofono_debug_desc __start___debug[];
|
extern struct ofono_debug_desc __start___debug[];
|
||||||
extern struct ofono_debug_desc __stop___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)
|
if (detach == FALSE)
|
||||||
option |= LOG_PERROR;
|
option |= LOG_PERROR;
|
||||||
|
|
||||||
|
#ifdef __GLIBC__
|
||||||
signal_setup(signal_handler);
|
signal_setup(signal_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
openlog(basename(program), option, LOG_DAEMON);
|
openlog(basename(program), option, LOG_DAEMON);
|
||||||
|
|
||||||
|
@ -320,7 +326,9 @@ void __ofono_log_cleanup(void)
|
||||||
|
|
||||||
closelog();
|
closelog();
|
||||||
|
|
||||||
|
#ifdef __GLIBC__
|
||||||
signal_setup(SIG_DFL);
|
signal_setup(SIG_DFL);
|
||||||
|
#endif
|
||||||
|
|
||||||
g_strfreev(enabled);
|
g_strfreev(enabled);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue