summaryrefslogtreecommitdiffstats
path: root/tools
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 /tools
parentbc2a1554dfeeb8c7e20d1c3b80e26ec69759743e (diff)
downloadlibimobiledevice-9e1cfe984a4481c2251cd2cbdbab11d610fc1821.tar.gz
libimobiledevice-9e1cfe984a4481c2251cd2cbdbab11d610fc1821.tar.bz2
Add ERROR prefix to error messages in idevicediagnostics tool
Diffstat (limited to 'tools')
-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)
continue;
}
- printf("Unknown TYPE %s\n", argv[i]);
+ printf("ERROR: Unknown TYPE %s\n", argv[i]);
print_usage(argc, argv);
goto cleanup;
}
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
i++;
if (!argv[i] || argv[i] == NULL || (!strncmp(argv[i], "-", 1))) {
- printf("Please supply the key to query.\n");
+ printf("ERROR: Please supply the key to query.\n");
print_usage(argc, argv);
goto cleanup;
}
@@ -208,10 +208,11 @@ int main(int argc, char **argv)
lockdownd_client_free(lockdown_client);
+ result = -1;
+
if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) {
if (diagnostics_relay_client_new(device, service, &diagnostics_client) != DIAGNOSTICS_RELAY_E_SUCCESS) {
- printf("Could not connect to diagnostics_relay!\n");
- result = -1;
+ printf("ERROR: Could not connect to diagnostics_relay!\n");
} else {
switch (cmd) {
case CMD_SLEEP:
@@ -219,7 +220,7 @@ int main(int argc, char **argv)
printf("Putting device into deep sleep mode.\n");
result = EXIT_SUCCESS;
} else {
- printf("Failed to put device into deep sleep mode.\n");
+ printf("ERROR: Failed to put device into deep sleep mode.\n");
}
break;
case CMD_RESTART:
@@ -227,7 +228,7 @@ int main(int argc, char **argv)
printf("Restarting device.\n");
result = EXIT_SUCCESS;
} else {
- printf("Failed to restart device.\n");
+ printf("ERROR: Failed to restart device.\n");
}
break;
case CMD_SHUTDOWN:
@@ -235,7 +236,7 @@ int main(int argc, char **argv)
printf("Shutting down device.\n");
result = EXIT_SUCCESS;
} else {
- printf("Failed to shutdown device.\n");
+ printf("ERROR: Failed to shutdown device.\n");
}
break;
case CMD_MOBILEGESTALT:
@@ -245,7 +246,7 @@ int main(int argc, char **argv)
result = EXIT_SUCCESS;
}
} else {
- printf("Unable to query mobilegestalt keys.\n");
+ printf("ERROR: Unable to query mobilegestalt keys.\n");
}
break;
case CMD_IOREGISTRY_ENTRY:
@@ -255,7 +256,7 @@ int main(int argc, char **argv)
result = EXIT_SUCCESS;
}
} else {
- printf("Unable to retrieve IORegistry from device.\n");
+ printf("ERROR: Unable to retrieve IORegistry from device.\n");
}
break;
case CMD_IOREGISTRY:
@@ -265,7 +266,7 @@ int main(int argc, char **argv)
result = EXIT_SUCCESS;
}
} else {
- printf("Unable to retrieve IORegistry from device.\n");
+ printf("ERROR: Unable to retrieve IORegistry from device.\n");
}
break;
case CMD_DIAGNOSTICS:
@@ -276,7 +277,7 @@ int main(int argc, char **argv)
result = EXIT_SUCCESS;
}
} else {
- printf("Unable to retrieve diagnostics from device.\n");
+ printf("ERROR: Unable to retrieve diagnostics from device.\n");
}
break;
}
@@ -285,7 +286,7 @@ int main(int argc, char **argv)
diagnostics_relay_client_free(diagnostics_client);
}
} else {
- printf("Could not start diagnostics service!\n");
+ printf("ERROR: Could not start diagnostics service!\n");
}
if (service) {