summaryrefslogtreecommitdiffstats
path: root/tools/idevicediagnostics.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-02-04 02:15:56 +0100
committerGravatar Nikias Bassen2022-02-04 02:15:56 +0100
commita64fcc3988f75cb4fc2388013c245e5e884bb96f (patch)
tree1b122ace4e0c658fbb80a2980a86eabc1114e0d2 /tools/idevicediagnostics.c
parentac89a1fed5ad916c81bca1515b10934e3e01b057 (diff)
downloadlibimobiledevice-a64fcc3988f75cb4fc2388013c245e5e884bb96f.tar.gz
libimobiledevice-a64fcc3988f75cb4fc2388013c245e5e884bb96f.tar.bz2
tools: Print meaningful error messages when service startup fails
Diffstat (limited to 'tools/idevicediagnostics.c')
-rw-r--r--tools/idevicediagnostics.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c
index 0e3e66e..66ed589 100644
--- a/tools/idevicediagnostics.c
+++ b/tools/idevicediagnostics.c
@@ -213,13 +213,18 @@ int main(int argc, char **argv)
213 213
214 /* attempt to use newer diagnostics service available on iOS 5 and later */ 214 /* attempt to use newer diagnostics service available on iOS 5 and later */
215 ret = lockdownd_start_service(lockdown_client, "com.apple.mobile.diagnostics_relay", &service); 215 ret = lockdownd_start_service(lockdown_client, "com.apple.mobile.diagnostics_relay", &service);
216 if (ret != LOCKDOWN_E_SUCCESS) { 216 if (ret == LOCKDOWN_E_INVALID_SERVICE) {
217 /* attempt to use older diagnostics service */ 217 /* attempt to use older diagnostics service */
218 ret = lockdownd_start_service(lockdown_client, "com.apple.iosdiagnostics.relay", &service); 218 ret = lockdownd_start_service(lockdown_client, "com.apple.iosdiagnostics.relay", &service);
219 } 219 }
220
221 lockdownd_client_free(lockdown_client); 220 lockdownd_client_free(lockdown_client);
222 221
222 if (ret != LOCKDOWN_E_SUCCESS) {
223 idevice_free(device);
224 printf("ERROR: Could not start diagnostics relay service: %s\n", lockdownd_strerror(ret));
225 goto cleanup;
226 }
227
223 result = EXIT_FAILURE; 228 result = EXIT_FAILURE;
224 229
225 if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) { 230 if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) {