diff options
| -rw-r--r-- | dev/syslog_relay.c | 5 |
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 @@ | |||
| 24 | #include <errno.h> | 24 | #include <errno.h> |
| 25 | #include <netinet/in.h> | 25 | #include <netinet/in.h> |
| 26 | #include <signal.h> | 26 | #include <signal.h> |
| 27 | #include <stdlib.h> | ||
| 27 | 28 | ||
| 28 | #include <libiphone/libiphone.h> | 29 | #include <libiphone/libiphone.h> |
| 29 | #include <usbmuxd.h> | 30 | #include <usbmuxd.h> |
| @@ -60,6 +61,7 @@ int main(int argc, char *argv[]) | |||
| 60 | for (i = 1; i < argc; i++) { | 61 | for (i = 1; i < argc; i++) { |
| 61 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 62 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
| 62 | iphone_set_debug_mask(DBGMASK_ALL); | 63 | iphone_set_debug_mask(DBGMASK_ALL); |
| 64 | iphone_set_debug(1); | ||
| 63 | continue; | 65 | continue; |
| 64 | } | 66 | } |
| 65 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 67 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { |
| @@ -105,6 +107,8 @@ int main(int argc, char *argv[]) | |||
| 105 | /* start syslog_relay service and retrieve port */ | 107 | /* start syslog_relay service and retrieve port */ |
| 106 | ret = iphone_lckd_start_service(control, "com.apple.syslog_relay", &port); | 108 | ret = iphone_lckd_start_service(control, "com.apple.syslog_relay", &port); |
| 107 | if ((ret == IPHONE_E_SUCCESS) && port) { | 109 | if ((ret == IPHONE_E_SUCCESS) && port) { |
| 110 | iphone_lckd_free_client(control); | ||
| 111 | |||
| 108 | /* connect to socket relay messages */ | 112 | /* connect to socket relay messages */ |
| 109 | 113 | ||
| 110 | int sfd = usbmuxd_connect(iphone_get_device_handle(phone), port); | 114 | int sfd = usbmuxd_connect(iphone_get_device_handle(phone), port); |
| @@ -143,7 +147,6 @@ int main(int argc, char *argv[]) | |||
| 143 | printf("ERROR: Could not start service com.apple.syslog_relay.\n"); | 147 | printf("ERROR: Could not start service com.apple.syslog_relay.\n"); |
| 144 | } | 148 | } |
| 145 | 149 | ||
| 146 | iphone_lckd_free_client(control); | ||
| 147 | iphone_free_device(phone); | 150 | iphone_free_device(phone); |
| 148 | 151 | ||
| 149 | return 0; | 152 | return 0; |
