summaryrefslogtreecommitdiffstats
path: root/dev/afccheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'dev/afccheck.c')
-rw-r--r--dev/afccheck.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c
index 2dab6db..ead0ca0 100644
--- a/dev/afccheck.c
+++ b/dev/afccheck.c
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
{
lockdownd_client_t client = NULL;
idevice_t phone = NULL;
- uint16_t port = 0;
+ lockdownd_service_descriptor_t service = NULL;
afc_client_t afc = NULL;
if (argc > 1 && !strcasecmp(argv[1], "--debug")) {
@@ -111,14 +111,19 @@ int main(int argc, char *argv[])
return 1;
}
- if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) {
+ if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &service) && !service->port) {
lockdownd_client_free(client);
idevice_free(phone);
fprintf(stderr, "Something went wrong when starting AFC.");
return 1;
}
- afc_client_new(phone, port, &afc);
+ afc_client_new(phone, service, &afc);
+
+ if (service) {
+ lockdownd_service_descriptor_free(service);
+ service = NULL;
+ }
pthread_t threads[NB_THREADS];
param data[NB_THREADS];