diff options
author | Nikias Bassen | 2020-06-05 20:50:34 +0200 |
---|---|---|
committer | Nikias Bassen | 2020-06-05 20:50:34 +0200 |
commit | 489a673aeeef4706af3986d41c24ab434e77d7d5 (patch) | |
tree | 123022859215220cf7f10a483d02bffdf157a0ce /tools/idevicepair.c | |
parent | 3aa4e243faa8198550cb2851cb6f0b9cbb293812 (diff) | |
download | libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.gz libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.bz2 |
tools: Unify --network command line switch and add it where missing
Diffstat (limited to 'tools/idevicepair.c')
-rw-r--r-- | tools/idevicepair.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/tools/idevicepair.c b/tools/idevicepair.c index de631a0..68507f4 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c @@ -202,30 +202,25 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } - if (udid) { - ret = idevice_new(&device, udid); - if (ret != IDEVICE_E_SUCCESS) { - printf("No device found with udid %s, is it plugged in?\n", udid); - free(udid); - return EXIT_FAILURE; + ret = idevice_new(&device, udid); + if (ret != IDEVICE_E_SUCCESS) { + if (udid) { + printf("No device found with udid %s.\n", udid); + } else { + printf("No device found.\n"); } free(udid); - udid = NULL; - } else { - ret = idevice_new(&device, NULL); + return EXIT_FAILURE; + } + if (!udid) { + ret = idevice_get_udid(device, &udid); if (ret != IDEVICE_E_SUCCESS) { - printf("No device found, is it plugged in?\n"); - return EXIT_FAILURE; + printf("ERROR: Could not get device udid, error code %d\n", ret); + result = EXIT_FAILURE; + goto leave; } } - ret = idevice_get_udid(device, &udid); - if (ret != IDEVICE_E_SUCCESS) { - printf("ERROR: Could not get device udid, error code %d\n", ret); - result = EXIT_FAILURE; - goto leave; - } - if (op == OP_HOSTID) { plist_t pair_record = NULL; char *hostid = NULL; @@ -244,7 +239,7 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } - lerr = lockdownd_client_new(device, &client, "idevicepair"); + lerr = lockdownd_client_new(device, &client, TOOL_NAME); if (lerr != LOCKDOWN_E_SUCCESS) { idevice_free(device); printf("ERROR: Could not connect to lockdownd, error code %d\n", lerr); |