diff options
author | Nikias Bassen | 2022-02-04 02:15:56 +0100 |
---|---|---|
committer | Nikias Bassen | 2022-02-04 02:15:56 +0100 |
commit | a64fcc3988f75cb4fc2388013c245e5e884bb96f (patch) | |
tree | 1b122ace4e0c658fbb80a2980a86eabc1114e0d2 /tools/idevicediagnostics.c | |
parent | ac89a1fed5ad916c81bca1515b10934e3e01b057 (diff) | |
download | libimobiledevice-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.c | 9 |
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) /* attempt to use newer diagnostics service available on iOS 5 and later */ ret = lockdownd_start_service(lockdown_client, "com.apple.mobile.diagnostics_relay", &service); - if (ret != LOCKDOWN_E_SUCCESS) { + if (ret == LOCKDOWN_E_INVALID_SERVICE) { /* attempt to use older diagnostics service */ ret = lockdownd_start_service(lockdown_client, "com.apple.iosdiagnostics.relay", &service); } - lockdownd_client_free(lockdown_client); + if (ret != LOCKDOWN_E_SUCCESS) { + idevice_free(device); + printf("ERROR: Could not start diagnostics relay service: %s\n", lockdownd_strerror(ret)); + goto cleanup; + } + result = EXIT_FAILURE; if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) { |