diff options
author | 2025-06-07 11:26:31 +0200 | |
---|---|---|
committer | 2025-06-07 11:26:31 +0200 | |
commit | eae0cd26b0aac975737393fb7d87efc871a0f5c2 (patch) | |
tree | 6110e2696bfd9431b27750d6f33ba4789e815b5d /tools | |
parent | f4d8e4f4a42efa6329b2adf6e8554d7235d5f95e (diff) | |
download | libimobiledevice-eae0cd26b0aac975737393fb7d87efc871a0f5c2.tar.gz libimobiledevice-eae0cd26b0aac975737393fb7d87efc871a0f5c2.tar.bz2 |
idevicesetlocation: Print proper lockdown error message when connection fails
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicesetlocation.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/idevicesetlocation.c b/tools/idevicesetlocation.c index 69fbaf5..a23b8e4 100644 --- a/tools/idevicesetlocation.c +++ b/tools/idevicesetlocation.c @@ -138,11 +138,16 @@ int main(int argc, char **argv) return -1; } - lockdownd_client_t lockdown; - lockdownd_client_new_with_handshake(device, &lockdown, TOOL_NAME); + lockdownd_client_t lockdown = NULL; + lockdownd_error_t lerr = lockdownd_client_new_with_handshake(device, &lockdown, TOOL_NAME); + if (lerr != LOCKDOWN_E_SUCCESS) { + idevice_free(device); + printf("ERROR: Could not connect to lockdownd: %s (%d)\n", lockdownd_strerror(lerr), lerr); + return -1; + } lockdownd_service_descriptor_t svc = NULL; - lockdownd_error_t lerr = lockdownd_start_service(lockdown, DT_SIMULATELOCATION_SERVICE, &svc); + lerr = lockdownd_start_service(lockdown, DT_SIMULATELOCATION_SERVICE, &svc); if (lerr != LOCKDOWN_E_SUCCESS) { lockdownd_client_free(lockdown); idevice_free(device); @@ -158,7 +163,6 @@ int main(int argc, char **argv) lockdownd_service_descriptor_free(svc); if (serr != SERVICE_E_SUCCESS) { - lockdownd_client_free(lockdown); idevice_free(device); printf("ERROR: Could not connect to simulatelocation service (%d)\n", serr); return -1; |