diff options
| author | 2025-06-07 11:26:31 +0200 | |
|---|---|---|
| committer | 2025-06-07 11:26:31 +0200 | |
| commit | eae0cd26b0aac975737393fb7d87efc871a0f5c2 (patch) | |
| tree | 6110e2696bfd9431b27750d6f33ba4789e815b5d | |
| parent | f4d8e4f4a42efa6329b2adf6e8554d7235d5f95e (diff) | |
| download | libimobiledevice-eae0cd26b0aac975737393fb7d87efc871a0f5c2.tar.gz libimobiledevice-eae0cd26b0aac975737393fb7d87efc871a0f5c2.tar.bz2 | |
idevicesetlocation: Print proper lockdown error message when connection fails
| -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) | |||
| 138 | return -1; | 138 | return -1; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | lockdownd_client_t lockdown; | 141 | lockdownd_client_t lockdown = NULL; |
| 142 | lockdownd_client_new_with_handshake(device, &lockdown, TOOL_NAME); | 142 | lockdownd_error_t lerr = lockdownd_client_new_with_handshake(device, &lockdown, TOOL_NAME); |
| 143 | if (lerr != LOCKDOWN_E_SUCCESS) { | ||
| 144 | idevice_free(device); | ||
| 145 | printf("ERROR: Could not connect to lockdownd: %s (%d)\n", lockdownd_strerror(lerr), lerr); | ||
| 146 | return -1; | ||
| 147 | } | ||
| 143 | 148 | ||
| 144 | lockdownd_service_descriptor_t svc = NULL; | 149 | lockdownd_service_descriptor_t svc = NULL; |
| 145 | lockdownd_error_t lerr = lockdownd_start_service(lockdown, DT_SIMULATELOCATION_SERVICE, &svc); | 150 | lerr = lockdownd_start_service(lockdown, DT_SIMULATELOCATION_SERVICE, &svc); |
| 146 | if (lerr != LOCKDOWN_E_SUCCESS) { | 151 | if (lerr != LOCKDOWN_E_SUCCESS) { |
| 147 | lockdownd_client_free(lockdown); | 152 | lockdownd_client_free(lockdown); |
| 148 | idevice_free(device); | 153 | idevice_free(device); |
| @@ -158,7 +163,6 @@ int main(int argc, char **argv) | |||
| 158 | lockdownd_service_descriptor_free(svc); | 163 | lockdownd_service_descriptor_free(svc); |
| 159 | 164 | ||
| 160 | if (serr != SERVICE_E_SUCCESS) { | 165 | if (serr != SERVICE_E_SUCCESS) { |
| 161 | lockdownd_client_free(lockdown); | ||
| 162 | idevice_free(device); | 166 | idevice_free(device); |
| 163 | printf("ERROR: Could not connect to simulatelocation service (%d)\n", serr); | 167 | printf("ERROR: Could not connect to simulatelocation service (%d)\n", serr); |
| 164 | return -1; | 168 | return -1; |
