diff options
| author | 2009-07-26 19:34:22 -0700 | |
|---|---|---|
| committer | 2009-07-26 19:34:22 -0700 | |
| commit | eea538c94f01f8054f69f059614f19400187a472 (patch) | |
| tree | 209a12dc8c8eaece15b8153d15e689c8c2147ab6 /dev/syslog_relay.c | |
| parent | 8ebfd7d8eea89bb27e4e6dbb1f37fd90d98b439c (diff) | |
| parent | 19c9750d670435ce430f0fc85a55faf127bdfbf9 (diff) | |
| download | libimobiledevice-eea538c94f01f8054f69f059614f19400187a472.tar.gz libimobiledevice-eea538c94f01f8054f69f059614f19400187a472.tar.bz2 | |
Merge commit 'martin-s/martin'
[#46 state:resolved]
Diffstat (limited to 'dev/syslog_relay.c')
| -rw-r--r-- | dev/syslog_relay.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/dev/syslog_relay.c b/dev/syslog_relay.c index a93e85b..a096101 100644 --- a/dev/syslog_relay.c +++ b/dev/syslog_relay.c | |||
| @@ -52,6 +52,7 @@ int main(int argc, char *argv[]) | |||
| 52 | char uuid[41]; | 52 | char uuid[41]; |
| 53 | int port = 0; | 53 | int port = 0; |
| 54 | uuid[0] = 0; | 54 | uuid[0] = 0; |
| 55 | uint32_t handle = 0; | ||
| 55 | 56 | ||
| 56 | signal(SIGINT, clean_exit); | 57 | signal(SIGINT, clean_exit); |
| 57 | signal(SIGQUIT, clean_exit); | 58 | signal(SIGQUIT, clean_exit); |
| @@ -62,7 +63,7 @@ int main(int argc, char *argv[]) | |||
| 62 | for (i = 1; i < argc; i++) { | 63 | for (i = 1; i < argc; i++) { |
| 63 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { | 64 | if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { |
| 64 | iphone_set_debug_mask(DBGMASK_ALL); | 65 | iphone_set_debug_mask(DBGMASK_ALL); |
| 65 | iphone_set_debug(1); | 66 | iphone_set_debug_level(1); |
| 66 | continue; | 67 | continue; |
| 67 | } | 68 | } |
| 68 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { | 69 | else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { |
| @@ -100,19 +101,19 @@ int main(int argc, char *argv[]) | |||
| 100 | } | 101 | } |
| 101 | } | 102 | } |
| 102 | 103 | ||
| 103 | if (IPHONE_E_SUCCESS != lockdownd_new_client(phone, &client)) { | 104 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { |
| 104 | iphone_free_device(phone); | 105 | iphone_device_free(phone); |
| 105 | return -1; | 106 | return -1; |
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | /* start syslog_relay service and retrieve port */ | 109 | /* start syslog_relay service and retrieve port */ |
| 109 | ret = lockdownd_start_service(client, "com.apple.syslog_relay", &port); | 110 | ret = lockdownd_start_service(client, "com.apple.syslog_relay", &port); |
| 110 | if ((ret == IPHONE_E_SUCCESS) && port) { | 111 | if ((ret == LOCKDOWN_E_SUCCESS) && port) { |
| 111 | lockdownd_free_client(client); | 112 | lockdownd_client_free(client); |
| 112 | 113 | ||
| 113 | /* connect to socket relay messages */ | 114 | /* connect to socket relay messages */ |
| 114 | 115 | iphone_device_get_handle(phone, &handle); | |
| 115 | int sfd = usbmuxd_connect(iphone_get_device_handle(phone), port); | 116 | int sfd = usbmuxd_connect(handle, port); |
| 116 | if (sfd < 0) { | 117 | if (sfd < 0) { |
| 117 | printf("ERROR: Could not open usbmux connection.\n"); | 118 | printf("ERROR: Could not open usbmux connection.\n"); |
| 118 | } else { | 119 | } else { |
| @@ -148,7 +149,7 @@ int main(int argc, char *argv[]) | |||
| 148 | printf("ERROR: Could not start service com.apple.syslog_relay.\n"); | 149 | printf("ERROR: Could not start service com.apple.syslog_relay.\n"); |
| 149 | } | 150 | } |
| 150 | 151 | ||
| 151 | iphone_free_device(phone); | 152 | iphone_device_free(phone); |
| 152 | 153 | ||
| 153 | return 0; | 154 | return 0; |
| 154 | } | 155 | } |
