summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-06-21 23:02:22 +0200
committerGravatar Martin Szulecki2009-06-21 23:02:22 +0200
commit0727ae7c72bf149bf5898c667933a27d44e94f7d (patch)
treeacdf0a66879ef394a84a914b0b2a8b3bb20f0764
parentbdeaf4eb9c6b3d40bc4be3a13e9c0f8c9ed5f429 (diff)
downloadlibimobiledevice-0727ae7c72bf149bf5898c667933a27d44e94f7d.tar.gz
libimobiledevice-0727ae7c72bf149bf5898c667933a27d44e94f7d.tar.bz2
Lkdn times out after few seconds idle so close it early and fix a crash on quit
-rw-r--r--dev/syslog_relay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dev/syslog_relay.c b/dev/syslog_relay.c
index 3407f2f..e552e9c 100644
--- a/dev/syslog_relay.c
+++ b/dev/syslog_relay.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <netinet/in.h>
#include <signal.h>
+#include <stdlib.h>
#include <libiphone/libiphone.h>
#include <usbmuxd.h>
@@ -60,6 +61,7 @@ int main(int argc, char *argv[])
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
iphone_set_debug_mask(DBGMASK_ALL);
+ iphone_set_debug(1);
continue;
}
else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) {
@@ -105,6 +107,8 @@ int main(int argc, char *argv[])
/* start syslog_relay service and retrieve port */
ret = iphone_lckd_start_service(control, "com.apple.syslog_relay", &port);
if ((ret == IPHONE_E_SUCCESS) && port) {
+ iphone_lckd_free_client(control);
+
/* connect to socket relay messages */
int sfd = usbmuxd_connect(iphone_get_device_handle(phone), port);
@@ -143,7 +147,6 @@ int main(int argc, char *argv[])
printf("ERROR: Could not start service com.apple.syslog_relay.\n");
}
- iphone_lckd_free_client(control);
iphone_free_device(phone);
return 0;