summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/idevice_id.c12
-rw-r--r--tools/idevicebackup.c22
-rw-r--r--tools/idevicebackup2.c24
-rw-r--r--tools/idevicedate.c10
-rw-r--r--tools/ideviceenterrecovery.c10
-rw-r--r--tools/ideviceinfo.c12
-rw-r--r--tools/idevicepair.c14
-rw-r--r--tools/idevicesyslog.c12
8 files changed, 58 insertions, 58 deletions
diff --git a/tools/idevice_id.c b/tools/idevice_id.c
index 108aad4..c9ade46 100644
--- a/tools/idevice_id.c
+++ b/tools/idevice_id.c
@@ -46,7 +46,7 @@ static void print_usage(int argc, char **argv)
46 46
47int main(int argc, char **argv) 47int main(int argc, char **argv)
48{ 48{
49 idevice_t phone = NULL; 49 idevice_t device = NULL;
50 lockdownd_client_t client = NULL; 50 lockdownd_client_t client = NULL;
51 char **dev_list = NULL; 51 char **dev_list = NULL;
52 char *devname = NULL; 52 char *devname = NULL;
@@ -83,14 +83,14 @@ int main(int argc, char **argv)
83 83
84 switch (mode) { 84 switch (mode) {
85 case MODE_SHOW_ID: 85 case MODE_SHOW_ID:
86 idevice_new(&phone, udid); 86 idevice_new(&device, udid);
87 if (!phone) { 87 if (!device) {
88 fprintf(stderr, "ERROR: No device with UDID=%s attached.\n", udid); 88 fprintf(stderr, "ERROR: No device with UDID=%s attached.\n", udid);
89 return -2; 89 return -2;
90 } 90 }
91 91
92 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client, "idevice_id")) { 92 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(device, &client, "idevice_id")) {
93 idevice_free(phone); 93 idevice_free(device);
94 fprintf(stderr, "ERROR: Connecting to device failed!\n"); 94 fprintf(stderr, "ERROR: Connecting to device failed!\n");
95 return -2; 95 return -2;
96 } 96 }
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
101 } 101 }
102 102
103 lockdownd_client_free(client); 103 lockdownd_client_free(client);
104 idevice_free(phone); 104 idevice_free(device);
105 105
106 if (ret == 0) { 106 if (ret == 0) {
107 printf("%s\n", devname); 107 printf("%s\n", devname);
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index b4e0158..86b81da 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -56,7 +56,7 @@
56 56
57static mobilebackup_client_t mobilebackup = NULL; 57static mobilebackup_client_t mobilebackup = NULL;
58static lockdownd_client_t client = NULL; 58static lockdownd_client_t client = NULL;
59static idevice_t phone = NULL; 59static idevice_t device = NULL;
60 60
61static int quit_flag = 0; 61static int quit_flag = 0;
62 62
@@ -748,14 +748,14 @@ static void do_post_notification(const char *notification)
748 np_client_t np; 748 np_client_t np;
749 749
750 if (!client) { 750 if (!client) {
751 if (lockdownd_client_new_with_handshake(phone, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) { 751 if (lockdownd_client_new_with_handshake(device, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) {
752 return; 752 return;
753 } 753 }
754 } 754 }
755 755
756 lockdownd_start_service(client, NP_SERVICE_NAME, &nport); 756 lockdownd_start_service(client, NP_SERVICE_NAME, &nport);
757 if (nport) { 757 if (nport) {
758 np_client_new(phone, nport, &np); 758 np_client_new(device, nport, &np);
759 if (np) { 759 if (np) {
760 np_post_notification(np, notification); 760 np_post_notification(np, notification);
761 np_client_free(np); 761 np_client_free(np);
@@ -908,7 +908,7 @@ int main(int argc, char *argv[])
908 printf("Backup directory is \"%s\"\n", backup_directory); 908 printf("Backup directory is \"%s\"\n", backup_directory);
909 909
910 if (udid) { 910 if (udid) {
911 ret = idevice_new(&phone, udid); 911 ret = idevice_new(&device, udid);
912 if (ret != IDEVICE_E_SUCCESS) { 912 if (ret != IDEVICE_E_SUCCESS) {
913 printf("No device found with udid %s, is it plugged in?\n", udid); 913 printf("No device found with udid %s, is it plugged in?\n", udid);
914 return -1; 914 return -1;
@@ -916,15 +916,15 @@ int main(int argc, char *argv[])
916 } 916 }
917 else 917 else
918 { 918 {
919 ret = idevice_new(&phone, NULL); 919 ret = idevice_new(&device, NULL);
920 if (ret != IDEVICE_E_SUCCESS) { 920 if (ret != IDEVICE_E_SUCCESS) {
921 printf("No device found, is it plugged in?\n"); 921 printf("No device found, is it plugged in?\n");
922 return -1; 922 return -1;
923 } 923 }
924 } 924 }
925 925
926 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicebackup")) { 926 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &client, "idevicebackup")) {
927 idevice_free(phone); 927 idevice_free(device);
928 return -1; 928 return -1;
929 } 929 }
930 930
@@ -932,7 +932,7 @@ int main(int argc, char *argv[])
932 np_client_t np = NULL; 932 np_client_t np = NULL;
933 ret = lockdownd_start_service(client, NP_SERVICE_NAME, &port); 933 ret = lockdownd_start_service(client, NP_SERVICE_NAME, &port);
934 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 934 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
935 np_client_new(phone, port, &np); 935 np_client_new(device, port, &np);
936 np_set_notify_callback(np, notify_cb, NULL); 936 np_set_notify_callback(np, notify_cb, NULL);
937 const char *noties[5] = { 937 const char *noties[5] = {
938 NP_SYNC_CANCEL_REQUEST, 938 NP_SYNC_CANCEL_REQUEST,
@@ -952,7 +952,7 @@ int main(int argc, char *argv[])
952 port = 0; 952 port = 0;
953 ret = lockdownd_start_service(client, "com.apple.afc", &port); 953 ret = lockdownd_start_service(client, "com.apple.afc", &port);
954 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 954 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
955 afc_client_new(phone, port, &afc); 955 afc_client_new(device, port, &afc);
956 } 956 }
957 } 957 }
958 958
@@ -961,7 +961,7 @@ int main(int argc, char *argv[])
961 ret = lockdownd_start_service(client, MOBILEBACKUP_SERVICE_NAME, &port); 961 ret = lockdownd_start_service(client, MOBILEBACKUP_SERVICE_NAME, &port);
962 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 962 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
963 printf("Started \"%s\" service on port %d.\n", MOBILEBACKUP_SERVICE_NAME, port); 963 printf("Started \"%s\" service on port %d.\n", MOBILEBACKUP_SERVICE_NAME, port);
964 mobilebackup_client_new(phone, port, &mobilebackup); 964 mobilebackup_client_new(device, port, &mobilebackup);
965 965
966 /* check abort conditions */ 966 /* check abort conditions */
967 if (quit_flag > 0) { 967 if (quit_flag > 0) {
@@ -1694,7 +1694,7 @@ files_out:
1694 if (mobilebackup) 1694 if (mobilebackup)
1695 mobilebackup_client_free(mobilebackup); 1695 mobilebackup_client_free(mobilebackup);
1696 1696
1697 idevice_free(phone); 1697 idevice_free(device);
1698 1698
1699 if (udid) { 1699 if (udid) {
1700 free(udid); 1700 free(udid);
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 566a41f..0a06f3f 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -60,7 +60,7 @@
60static mobilebackup2_client_t mobilebackup2 = NULL; 60static mobilebackup2_client_t mobilebackup2 = NULL;
61static lockdownd_client_t client = NULL; 61static lockdownd_client_t client = NULL;
62static afc_client_t afc = NULL; 62static afc_client_t afc = NULL;
63static idevice_t phone = NULL; 63static idevice_t device = NULL;
64 64
65static int verbose = 1; 65static int verbose = 1;
66static int quit_flag = 0; 66static int quit_flag = 0;
@@ -539,14 +539,14 @@ static void do_post_notification(const char *notification)
539 np_client_t np; 539 np_client_t np;
540 540
541 if (!client) { 541 if (!client) {
542 if (lockdownd_client_new_with_handshake(phone, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) { 542 if (lockdownd_client_new_with_handshake(device, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) {
543 return; 543 return;
544 } 544 }
545 } 545 }
546 546
547 lockdownd_start_service(client, NP_SERVICE_NAME, &nport); 547 lockdownd_start_service(client, NP_SERVICE_NAME, &nport);
548 if (nport) { 548 if (nport) {
549 np_client_new(phone, nport, &np); 549 np_client_new(device, nport, &np);
550 if (np) { 550 if (np) {
551 np_post_notification(np, notification); 551 np_post_notification(np, notification);
552 np_client_free(np); 552 np_client_free(np);
@@ -1291,7 +1291,7 @@ int main(int argc, char *argv[])
1291 } 1291 }
1292 1292
1293 if (udid) { 1293 if (udid) {
1294 ret = idevice_new(&phone, udid); 1294 ret = idevice_new(&device, udid);
1295 if (ret != IDEVICE_E_SUCCESS) { 1295 if (ret != IDEVICE_E_SUCCESS) {
1296 printf("No device found with udid %s, is it plugged in?\n", udid); 1296 printf("No device found with udid %s, is it plugged in?\n", udid);
1297 return -1; 1297 return -1;
@@ -1299,12 +1299,12 @@ int main(int argc, char *argv[])
1299 } 1299 }
1300 else 1300 else
1301 { 1301 {
1302 ret = idevice_new(&phone, NULL); 1302 ret = idevice_new(&device, NULL);
1303 if (ret != IDEVICE_E_SUCCESS) { 1303 if (ret != IDEVICE_E_SUCCESS) {
1304 printf("No device found, is it plugged in?\n"); 1304 printf("No device found, is it plugged in?\n");
1305 return -1; 1305 return -1;
1306 } 1306 }
1307 idevice_get_udid(phone, &udid); 1307 idevice_get_udid(device, &udid);
1308 } 1308 }
1309 1309
1310 /* backup directory must contain an Info.plist */ 1310 /* backup directory must contain an Info.plist */
@@ -1319,8 +1319,8 @@ int main(int argc, char *argv[])
1319 1319
1320 PRINT_VERBOSE(1, "Backup directory is \"%s\"\n", backup_directory); 1320 PRINT_VERBOSE(1, "Backup directory is \"%s\"\n", backup_directory);
1321 1321
1322 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicebackup")) { 1322 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &client, "idevicebackup")) {
1323 idevice_free(phone); 1323 idevice_free(device);
1324 return -1; 1324 return -1;
1325 } 1325 }
1326 1326
@@ -1328,7 +1328,7 @@ int main(int argc, char *argv[])
1328 np_client_t np = NULL; 1328 np_client_t np = NULL;
1329 ret = lockdownd_start_service(client, NP_SERVICE_NAME, &port); 1329 ret = lockdownd_start_service(client, NP_SERVICE_NAME, &port);
1330 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 1330 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
1331 np_client_new(phone, port, &np); 1331 np_client_new(device, port, &np);
1332 np_set_notify_callback(np, notify_cb, NULL); 1332 np_set_notify_callback(np, notify_cb, NULL);
1333 const char *noties[5] = { 1333 const char *noties[5] = {
1334 NP_SYNC_CANCEL_REQUEST, 1334 NP_SYNC_CANCEL_REQUEST,
@@ -1348,7 +1348,7 @@ int main(int argc, char *argv[])
1348 port = 0; 1348 port = 0;
1349 ret = lockdownd_start_service(client, "com.apple.afc", &port); 1349 ret = lockdownd_start_service(client, "com.apple.afc", &port);
1350 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 1350 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
1351 afc_client_new(phone, port, &afc); 1351 afc_client_new(device, port, &afc);
1352 } 1352 }
1353 } 1353 }
1354 1354
@@ -1357,7 +1357,7 @@ int main(int argc, char *argv[])
1357 ret = lockdownd_start_service(client, MOBILEBACKUP2_SERVICE_NAME, &port); 1357 ret = lockdownd_start_service(client, MOBILEBACKUP2_SERVICE_NAME, &port);
1358 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 1358 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
1359 PRINT_VERBOSE(1, "Started \"%s\" service on port %d.\n", MOBILEBACKUP2_SERVICE_NAME, port); 1359 PRINT_VERBOSE(1, "Started \"%s\" service on port %d.\n", MOBILEBACKUP2_SERVICE_NAME, port);
1360 mobilebackup2_client_new(phone, port, &mobilebackup2); 1360 mobilebackup2_client_new(device, port, &mobilebackup2);
1361 1361
1362 /* send Hello message */ 1362 /* send Hello message */
1363 double local_versions[2] = {2.0, 2.1}; 1363 double local_versions[2] = {2.0, 2.1};
@@ -1884,7 +1884,7 @@ files_out:
1884 if (np) 1884 if (np)
1885 np_client_free(np); 1885 np_client_free(np);
1886 1886
1887 idevice_free(phone); 1887 idevice_free(device);
1888 1888
1889 if (udid) { 1889 if (udid) {
1890 free(udid); 1890 free(udid);
diff --git a/tools/idevicedate.c b/tools/idevicedate.c
index 19f7c1d..bde6786 100644
--- a/tools/idevicedate.c
+++ b/tools/idevicedate.c
@@ -54,7 +54,7 @@ static void print_usage(int argc, char **argv)
54int main(int argc, char *argv[]) 54int main(int argc, char *argv[])
55{ 55{
56 lockdownd_client_t client = NULL; 56 lockdownd_client_t client = NULL;
57 idevice_t phone = NULL; 57 idevice_t device = NULL;
58 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; 58 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
59 int i; 59 int i;
60 const char* udid = NULL; 60 const char* udid = NULL;
@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
123 } 123 }
124 } 124 }
125 125
126 ret = idevice_new(&phone, udid); 126 ret = idevice_new(&device, udid);
127 if (ret != IDEVICE_E_SUCCESS) { 127 if (ret != IDEVICE_E_SUCCESS) {
128 if (udid) { 128 if (udid) {
129 printf("No device found with udid %s, is it plugged in?\n", udid); 129 printf("No device found with udid %s, is it plugged in?\n", udid);
@@ -133,8 +133,8 @@ int main(int argc, char *argv[])
133 return -1; 133 return -1;
134 } 134 }
135 135
136 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicedate")) { 136 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &client, "idevicedate")) {
137 idevice_free(phone); 137 idevice_free(device);
138 return -1; 138 return -1;
139 } 139 }
140 140
@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
183 } 183 }
184 184
185 lockdownd_client_free(client); 185 lockdownd_client_free(client);
186 idevice_free(phone); 186 idevice_free(device);
187 187
188 return 0; 188 return 0;
189} 189}
diff --git a/tools/ideviceenterrecovery.c b/tools/ideviceenterrecovery.c
index 62df70f..444d531 100644
--- a/tools/ideviceenterrecovery.c
+++ b/tools/ideviceenterrecovery.c
@@ -42,7 +42,7 @@ static void print_usage(int argc, char **argv)
42int main(int argc, char *argv[]) 42int main(int argc, char *argv[])
43{ 43{
44 lockdownd_client_t client = NULL; 44 lockdownd_client_t client = NULL;
45 idevice_t phone = NULL; 45 idevice_t device = NULL;
46 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; 46 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
47 int i; 47 int i;
48 const char* udid = NULL; 48 const char* udid = NULL;
@@ -66,14 +66,14 @@ int main(int argc, char *argv[])
66 } 66 }
67 udid = argv[i]; 67 udid = argv[i];
68 68
69 ret = idevice_new(&phone, udid); 69 ret = idevice_new(&device, udid);
70 if (ret != IDEVICE_E_SUCCESS) { 70 if (ret != IDEVICE_E_SUCCESS) {
71 printf("No device found with udid %s, is it plugged in?\n", udid); 71 printf("No device found with udid %s, is it plugged in?\n", udid);
72 return -1; 72 return -1;
73 } 73 }
74 74
75 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client, "ideviceenterrecovery")) { 75 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(device, &client, "ideviceenterrecovery")) {
76 idevice_free(phone); 76 idevice_free(device);
77 return -1; 77 return -1;
78 } 78 }
79 79
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
86 printf("Device is successfully switching to recovery mode.\n"); 86 printf("Device is successfully switching to recovery mode.\n");
87 87
88 lockdownd_client_free(client); 88 lockdownd_client_free(client);
89 idevice_free(phone); 89 idevice_free(device);
90 90
91 return 0; 91 return 0;
92} 92}
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c
index 8635a48..c8d4cac 100644
--- a/tools/ideviceinfo.c
+++ b/tools/ideviceinfo.c
@@ -280,7 +280,7 @@ static void print_usage(int argc, char **argv)
280int main(int argc, char *argv[]) 280int main(int argc, char *argv[])
281{ 281{
282 lockdownd_client_t client = NULL; 282 lockdownd_client_t client = NULL;
283 idevice_t phone = NULL; 283 idevice_t device = NULL;
284 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; 284 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
285 int i; 285 int i;
286 int simple = 0; 286 int simple = 0;
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
347 } 347 }
348 } 348 }
349 349
350 ret = idevice_new(&phone, udid); 350 ret = idevice_new(&device, udid);
351 if (ret != IDEVICE_E_SUCCESS) { 351 if (ret != IDEVICE_E_SUCCESS) {
352 if (udid) { 352 if (udid) {
353 printf("No device found with udid %s, is it plugged in?\n", udid); 353 printf("No device found with udid %s, is it plugged in?\n", udid);
@@ -358,9 +358,9 @@ int main(int argc, char *argv[])
358 } 358 }
359 359
360 if (LOCKDOWN_E_SUCCESS != (simple ? 360 if (LOCKDOWN_E_SUCCESS != (simple ?
361 lockdownd_client_new(phone, &client, "ideviceinfo"): 361 lockdownd_client_new(device, &client, "ideviceinfo"):
362 lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo"))) { 362 lockdownd_client_new_with_handshake(device, &client, "ideviceinfo"))) {
363 idevice_free(phone); 363 idevice_free(device);
364 return -1; 364 return -1;
365 } 365 }
366 366
@@ -394,7 +394,7 @@ int main(int argc, char *argv[])
394 if (domain != NULL) 394 if (domain != NULL)
395 free(domain); 395 free(domain);
396 lockdownd_client_free(client); 396 lockdownd_client_free(client);
397 idevice_free(phone); 397 idevice_free(device);
398 398
399 return 0; 399 return 0;
400} 400}
diff --git a/tools/idevicepair.c b/tools/idevicepair.c
index 35147a4..dddb6ee 100644
--- a/tools/idevicepair.c
+++ b/tools/idevicepair.c
@@ -91,7 +91,7 @@ static void parse_opts(int argc, char **argv)
91int main(int argc, char **argv) 91int main(int argc, char **argv)
92{ 92{
93 lockdownd_client_t client = NULL; 93 lockdownd_client_t client = NULL;
94 idevice_t phone = NULL; 94 idevice_t device = NULL;
95 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; 95 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
96 lockdownd_error_t lerr; 96 lockdownd_error_t lerr;
97 int result; 97 int result;
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
158 } 158 }
159 159
160 if (udid) { 160 if (udid) {
161 ret = idevice_new(&phone, udid); 161 ret = idevice_new(&device, udid);
162 free(udid); 162 free(udid);
163 udid = NULL; 163 udid = NULL;
164 if (ret != IDEVICE_E_SUCCESS) { 164 if (ret != IDEVICE_E_SUCCESS) {
@@ -166,16 +166,16 @@ int main(int argc, char **argv)
166 return EXIT_FAILURE; 166 return EXIT_FAILURE;
167 } 167 }
168 } else { 168 } else {
169 ret = idevice_new(&phone, NULL); 169 ret = idevice_new(&device, NULL);
170 if (ret != IDEVICE_E_SUCCESS) { 170 if (ret != IDEVICE_E_SUCCESS) {
171 printf("No device found, is it plugged in?\n"); 171 printf("No device found, is it plugged in?\n");
172 return EXIT_FAILURE; 172 return EXIT_FAILURE;
173 } 173 }
174 } 174 }
175 175
176 lerr = lockdownd_client_new(phone, &client, "idevicepair"); 176 lerr = lockdownd_client_new(device, &client, "idevicepair");
177 if (lerr != LOCKDOWN_E_SUCCESS) { 177 if (lerr != LOCKDOWN_E_SUCCESS) {
178 idevice_free(phone); 178 idevice_free(device);
179 printf("ERROR: lockdownd_client_new failed with error code %d\n", lerr); 179 printf("ERROR: lockdownd_client_new failed with error code %d\n", lerr);
180 return EXIT_FAILURE; 180 return EXIT_FAILURE;
181 } 181 }
@@ -196,7 +196,7 @@ int main(int argc, char **argv)
196 } 196 }
197 } 197 }
198 198
199 ret = idevice_get_udid(phone, &udid); 199 ret = idevice_get_udid(device, &udid);
200 if (ret != IDEVICE_E_SUCCESS) { 200 if (ret != IDEVICE_E_SUCCESS) {
201 printf("ERROR: Could not get device udid, error code %d\n", ret); 201 printf("ERROR: Could not get device udid, error code %d\n", ret);
202 result = EXIT_FAILURE; 202 result = EXIT_FAILURE;
@@ -254,7 +254,7 @@ int main(int argc, char **argv)
254 254
255leave: 255leave:
256 lockdownd_client_free(client); 256 lockdownd_client_free(client);
257 idevice_free(phone); 257 idevice_free(device);
258 if (udid) { 258 if (udid) {
259 free(udid); 259 free(udid);
260 } 260 }
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c
index 73dd8e1..a17999c 100644
--- a/tools/idevicesyslog.c
+++ b/tools/idevicesyslog.c
@@ -45,7 +45,7 @@ static void clean_exit(int sig)
45int main(int argc, char *argv[]) 45int main(int argc, char *argv[])
46{ 46{
47 lockdownd_client_t client = NULL; 47 lockdownd_client_t client = NULL;
48 idevice_t phone = NULL; 48 idevice_t device = NULL;
49 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; 49 idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR;
50 int i; 50 int i;
51 const char* udid = NULL; 51 const char* udid = NULL;
@@ -83,7 +83,7 @@ int main(int argc, char *argv[])
83 } 83 }
84 } 84 }
85 85
86 ret = idevice_new(&phone, udid); 86 ret = idevice_new(&device, udid);
87 if (ret != IDEVICE_E_SUCCESS) { 87 if (ret != IDEVICE_E_SUCCESS) {
88 if (udid) { 88 if (udid) {
89 printf("No device found with udid %s, is it plugged in?\n", udid); 89 printf("No device found with udid %s, is it plugged in?\n", udid);
@@ -93,8 +93,8 @@ int main(int argc, char *argv[])
93 return -1; 93 return -1;
94 } 94 }
95 95
96 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicesyslog")) { 96 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &client, "idevicesyslog")) {
97 idevice_free(phone); 97 idevice_free(device);
98 return -1; 98 return -1;
99 } 99 }
100 100
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
105 105
106 /* connect to socket relay messages */ 106 /* connect to socket relay messages */
107 idevice_connection_t conn = NULL; 107 idevice_connection_t conn = NULL;
108 if ((idevice_connect(phone, port, &conn) != IDEVICE_E_SUCCESS) || !conn) { 108 if ((idevice_connect(device, port, &conn) != IDEVICE_E_SUCCESS) || !conn) {
109 printf("ERROR: Could not open usbmux connection.\n"); 109 printf("ERROR: Could not open usbmux connection.\n");
110 } else { 110 } else {
111 while (!quit_flag) { 111 while (!quit_flag) {
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
126 printf("ERROR: Could not start service com.apple.syslog_relay.\n"); 126 printf("ERROR: Could not start service com.apple.syslog_relay.\n");
127 } 127 }
128 128
129 idevice_free(phone); 129 idevice_free(device);
130 130
131 return 0; 131 return 0;
132} 132}