[PATCH] make it build against musl
by Sergey Alirzaev
ifdef away GNU libc extensions and use a POSIXly correct pointer type
---
gatchat/ppp_net.c | 2 +-
src/log.c | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/gatchat/ppp_net.c b/gatchat/ppp_net.c
index 813ed9b..914ca53 100644
--- a/gatchat/ppp_net.c
+++ b/gatchat/ppp_net.c
@@ -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));
ifr.ifr_mtu = mtu;
- err = ioctl(sk, SIOCSIFMTU, (caddr_t) &ifr);
+ err = ioctl(sk, SIOCSIFMTU, (void *) &ifr);
close(sk);
diff --git a/src/log.c b/src/log.c
index febc874..6331b0d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -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);
}
--
2.4.1
6 years, 12 months
HE910 + ofono: "Activating context failed with error: Unknown error type"
by Marko Sulejic
Hi,
I need your help in using a Telit HE910 with ofono (and eventually connman).
(I am using ofono 1.16 with HE910 firmware version 12.00.006; connman
version is 1.29).
My problem is the following ...
on startup everything works fine and the ppp0 connection is established,
but problems occur in the following case:
connmanctl> disconnect cellular_*_context15
Disconnected cellular_*_context15
connmanctl> connect cellular_*_context15
Error /net/connman/service/cellular_*_context15: Input/output error
ofonod[5355]: gprs-context.c(244):at_gprs_activate_primary() cid 1
ofonod[5355]: gprs.c(889):pri_activate_callback() 0x1a18c50
ofonod[5355]: gprs.c(893):pri_activate_callback() Activating context
failed with error: Unknown error type
connmand[3815]: Failed to change property: /he910_0/context15
org.ofono.ConnectionContext.Active: org.ofono.Error.Failed Operation failed
The same error happens if I am manually sending connect/disconnect via
dbus-send.
Only a hard ofono restart can establish the connection again.
This behavior happens all the time once a ppp0 disconnect happened
(e.g. by removing the SIM; manual disconnect via dbus or connmanctl).
A subquestion regarding connman:
Can connmand be configured in such a way that on every connection
loss, ofono is triggered to reconnect to the Internet?
Thank you very muchin advance,
Marko
6 years, 12 months