summaryrefslogtreecommitdiffstats
path: root/tools/idevicesetlocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicesetlocation.c')
-rw-r--r--tools/idevicesetlocation.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/idevicesetlocation.c b/tools/idevicesetlocation.c
index 47f15ca..6332e3c 100644
--- a/tools/idevicesetlocation.c
+++ b/tools/idevicesetlocation.c
@@ -54,7 +54,7 @@ static void print_usage(int argc, char **argv, int is_error)
54 fprintf(is_error ? stderr : stdout, "\n" \ 54 fprintf(is_error ? stderr : stdout, "\n" \
55 "OPTIONS:\n" \ 55 "OPTIONS:\n" \
56 " -u, --udid UDID target specific device by UDID\n" \ 56 " -u, --udid UDID target specific device by UDID\n" \
57 " -n, --network connect to network device even if available via USB\n" \ 57 " -n, --network connect to network device\n" \
58 " -d, --debug enable communication debugging\n" \ 58 " -d, --debug enable communication debugging\n" \
59 " -h, --help prints usage information\n" \ 59 " -h, --help prints usage information\n" \
60 " -v, --version prints version information\n" \ 60 " -v, --version prints version information\n" \
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
77 }; 77 };
78 uint32_t mode = 0; 78 uint32_t mode = 0;
79 char *udid = NULL; 79 char *udid = NULL;
80 enum idevice_options lookup_opts = IDEVICE_LOOKUP_USBMUX | IDEVICE_LOOKUP_NETWORK; 80 int use_network = 0;
81 81
82 while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) { 82 while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) {
83 switch (c) { 83 switch (c) {
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
94 udid = strdup(optarg); 94 udid = strdup(optarg);
95 break; 95 break;
96 case 'n': 96 case 'n':
97 lookup_opts |= IDEVICE_LOOKUP_PREFER_NETWORK; 97 use_network = 1;
98 break; 98 break;
99 case 'h': 99 case 'h':
100 print_usage(argc, argv, 0); 100 print_usage(argc, argv, 0);
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
129 129
130 idevice_t device = NULL; 130 idevice_t device = NULL;
131 131
132 if (idevice_new_with_options(&device, udid, lookup_opts) != IDEVICE_E_SUCCESS) { 132 if (idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX) != IDEVICE_E_SUCCESS) {
133 if (udid) { 133 if (udid) {
134 printf("ERROR: Device %s not found!\n", udid); 134 printf("ERROR: Device %s not found!\n", udid);
135 } else { 135 } else {