summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-06-21 23:02:22 +0200
committerGravatar Matt Colyer2009-06-29 19:31:01 -0700
commit4f47cf301238755327f3990d98fcd4c8e765612b (patch)
treeaa3995c70d0ded75adc6ba4974a2d183d918bb1e
parentb0100c6a97b94bf24609ec2ddb52d6bd7d0a5e70 (diff)
downloadlibimobiledevice-4f47cf301238755327f3990d98fcd4c8e765612b.tar.gz
libimobiledevice-4f47cf301238755327f3990d98fcd4c8e765612b.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;