summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2020-06-04 03:12:02 +0200
committerGravatar Martin Szulecki2020-06-04 03:12:02 +0200
commit9e1cfe984a4481c2251cd2cbdbab11d610fc1821 (patch)
treec2ff9078c44f4ae284717ecace05f0b6d0b4df71
parentbc2a1554dfeeb8c7e20d1c3b80e26ec69759743e (diff)
downloadlibimobiledevice-9e1cfe984a4481c2251cd2cbdbab11d610fc1821.tar.gz
libimobiledevice-9e1cfe984a4481c2251cd2cbdbab11d610fc1821.tar.bz2
Add ERROR prefix to error messages in idevicediagnostics tool
-rw-r--r--tools/idevicediagnostics.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c
index f302d68..a23ff8b 100644
--- a/tools/idevicediagnostics.c
+++ b/tools/idevicediagnostics.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
123 continue; 123 continue;
124 } 124 }
125 125
126 printf("Unknown TYPE %s\n", argv[i]); 126 printf("ERROR: Unknown TYPE %s\n", argv[i]);
127 print_usage(argc, argv); 127 print_usage(argc, argv);
128 goto cleanup; 128 goto cleanup;
129 } 129 }
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
137 i++; 137 i++;
138 138
139 if (!argv[i] || argv[i] == NULL || (!strncmp(argv[i], "-", 1))) { 139 if (!argv[i] || argv[i] == NULL || (!strncmp(argv[i], "-", 1))) {
140 printf("Please supply the key to query.\n"); 140 printf("ERROR: Please supply the key to query.\n");
141 print_usage(argc, argv); 141 print_usage(argc, argv);
142 goto cleanup; 142 goto cleanup;
143 } 143 }
@@ -208,10 +208,11 @@ int main(int argc, char **argv)
208 208
209 lockdownd_client_free(lockdown_client); 209 lockdownd_client_free(lockdown_client);
210 210
211 result = -1;
212
211 if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) { 213 if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) {
212 if (diagnostics_relay_client_new(device, service, &diagnostics_client) != DIAGNOSTICS_RELAY_E_SUCCESS) { 214 if (diagnostics_relay_client_new(device, service, &diagnostics_client) != DIAGNOSTICS_RELAY_E_SUCCESS) {
213 printf("Could not connect to diagnostics_relay!\n"); 215 printf("ERROR: Could not connect to diagnostics_relay!\n");
214 result = -1;
215 } else { 216 } else {
216 switch (cmd) { 217 switch (cmd) {
217 case CMD_SLEEP: 218 case CMD_SLEEP:
@@ -219,7 +220,7 @@ int main(int argc, char **argv)
219 printf("Putting device into deep sleep mode.\n"); 220 printf("Putting device into deep sleep mode.\n");
220 result = EXIT_SUCCESS; 221 result = EXIT_SUCCESS;
221 } else { 222 } else {
222 printf("Failed to put device into deep sleep mode.\n"); 223 printf("ERROR: Failed to put device into deep sleep mode.\n");
223 } 224 }
224 break; 225 break;
225 case CMD_RESTART: 226 case CMD_RESTART:
@@ -227,7 +228,7 @@ int main(int argc, char **argv)
227 printf("Restarting device.\n"); 228 printf("Restarting device.\n");
228 result = EXIT_SUCCESS; 229 result = EXIT_SUCCESS;
229 } else { 230 } else {
230 printf("Failed to restart device.\n"); 231 printf("ERROR: Failed to restart device.\n");
231 } 232 }
232 break; 233 break;
233 case CMD_SHUTDOWN: 234 case CMD_SHUTDOWN:
@@ -235,7 +236,7 @@ int main(int argc, char **argv)
235 printf("Shutting down device.\n"); 236 printf("Shutting down device.\n");
236 result = EXIT_SUCCESS; 237 result = EXIT_SUCCESS;
237 } else { 238 } else {
238 printf("Failed to shutdown device.\n"); 239 printf("ERROR: Failed to shutdown device.\n");
239 } 240 }
240 break; 241 break;
241 case CMD_MOBILEGESTALT: 242 case CMD_MOBILEGESTALT:
@@ -245,7 +246,7 @@ int main(int argc, char **argv)
245 result = EXIT_SUCCESS; 246 result = EXIT_SUCCESS;
246 } 247 }
247 } else { 248 } else {
248 printf("Unable to query mobilegestalt keys.\n"); 249 printf("ERROR: Unable to query mobilegestalt keys.\n");
249 } 250 }
250 break; 251 break;
251 case CMD_IOREGISTRY_ENTRY: 252 case CMD_IOREGISTRY_ENTRY:
@@ -255,7 +256,7 @@ int main(int argc, char **argv)
255 result = EXIT_SUCCESS; 256 result = EXIT_SUCCESS;
256 } 257 }
257 } else { 258 } else {
258 printf("Unable to retrieve IORegistry from device.\n"); 259 printf("ERROR: Unable to retrieve IORegistry from device.\n");
259 } 260 }
260 break; 261 break;
261 case CMD_IOREGISTRY: 262 case CMD_IOREGISTRY:
@@ -265,7 +266,7 @@ int main(int argc, char **argv)
265 result = EXIT_SUCCESS; 266 result = EXIT_SUCCESS;
266 } 267 }
267 } else { 268 } else {
268 printf("Unable to retrieve IORegistry from device.\n"); 269 printf("ERROR: Unable to retrieve IORegistry from device.\n");
269 } 270 }
270 break; 271 break;
271 case CMD_DIAGNOSTICS: 272 case CMD_DIAGNOSTICS:
@@ -276,7 +277,7 @@ int main(int argc, char **argv)
276 result = EXIT_SUCCESS; 277 result = EXIT_SUCCESS;
277 } 278 }
278 } else { 279 } else {
279 printf("Unable to retrieve diagnostics from device.\n"); 280 printf("ERROR: Unable to retrieve diagnostics from device.\n");
280 } 281 }
281 break; 282 break;
282 } 283 }
@@ -285,7 +286,7 @@ int main(int argc, char **argv)
285 diagnostics_relay_client_free(diagnostics_client); 286 diagnostics_relay_client_free(diagnostics_client);
286 } 287 }
287 } else { 288 } else {
288 printf("Could not start diagnostics service!\n"); 289 printf("ERROR: Could not start diagnostics service!\n");
289 } 290 }
290 291
291 if (service) { 292 if (service) {