diff options
author | 2025-07-15 18:17:06 +0200 | |
---|---|---|
committer | 2025-07-15 18:17:48 +0200 | |
commit | c269d7e3a7c28ac33d05d5c3de6a8682f480abd0 (patch) | |
tree | 46f1b5ac3d73d414dcf44690dd8905c28007d1b5 /tools/idevicesyslog.c | |
parent | efcbdb6a46df50dafd47d1a4ff42019b044a1ca8 (diff) | |
download | libimobiledevice-c269d7e3a7c28ac33d05d5c3de6a8682f480abd0.tar.gz libimobiledevice-c269d7e3a7c28ac33d05d5c3de6a8682f480abd0.tar.bz2 |
idevicesyslog: Fix initial device enumeration
Diffstat (limited to 'tools/idevicesyslog.c')
-rw-r--r-- | tools/idevicesyslog.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index c8f4613..5b124b5 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c | |||
@@ -1233,8 +1233,16 @@ int main(int argc, char *argv[]) | |||
1233 | int num = 0; | 1233 | int num = 0; |
1234 | idevice_info_t *devices = NULL; | 1234 | idevice_info_t *devices = NULL; |
1235 | idevice_get_device_list_extended(&devices, &num); | 1235 | idevice_get_device_list_extended(&devices, &num); |
1236 | int count = 0; | ||
1237 | for (int i = 0; i < num; i++) { | ||
1238 | if (devices[i]->conn_type == CONNECTION_NETWORK && use_network) { | ||
1239 | count++; | ||
1240 | } else if (devices[i]->conn_type == CONNECTION_USBMUXD) { | ||
1241 | count++; | ||
1242 | } | ||
1243 | } | ||
1236 | idevice_device_list_extended_free(devices); | 1244 | idevice_device_list_extended_free(devices); |
1237 | if (num == 0) { | 1245 | if (count == 0) { |
1238 | if (!udid) { | 1246 | if (!udid) { |
1239 | fprintf(stderr, "No device found. Plug in a device or pass UDID with -u to wait for device to be available.\n"); | 1247 | fprintf(stderr, "No device found. Plug in a device or pass UDID with -u to wait for device to be available.\n"); |
1240 | return 1; | 1248 | return 1; |