summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 16:05:17 +0200
committerGravatar Nikias Bassen2012-07-17 16:05:17 +0200
commit995ed659864e14b7c55ee948889b3ffff7ff4991 (patch)
treec24e26ef05213a05e75d702e3123cb70fb0aa4f9 /src
parent5e8990bf24b1f5319d1d1d00007f02919753b175 (diff)
downloadidevicerestore-995ed659864e14b7c55ee948889b3ffff7ff4991.tar.gz
idevicerestore-995ed659864e14b7c55ee948889b3ffff7ff4991.tar.bz2
main/restore: Pass full client to restore mode and device discovery functions
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c4
-rw-r--r--src/restore.c8
-rw-r--r--src/restore.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index ed89ae8..47c9a4c 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -823,7 +823,7 @@ int check_mode(struct idevicerestore_client_t* client) {
mode = MODE_NORMAL;
}
- else if (!client->ecid && client->udid && (restore_check_mode(client->udid) == 0)) {
+ else if (!client->ecid && client->udid && (restore_check_mode(client) == 0)) {
mode = MODE_RESTORE;
}
@@ -839,7 +839,7 @@ int check_device(struct idevicerestore_client_t* client) {
switch (client->mode->index) {
case MODE_RESTORE:
if (!client->ecid && client->udid) {
- device = restore_check_device(client->udid);
+ device = restore_check_device(client);
if (device < 0) {
device = DEVICE_UNKNOWN;
}
diff --git a/src/restore.c b/src/restore.c
index 402de78..eb07763 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -88,7 +88,7 @@ void restore_client_free(struct idevicerestore_client_t* client) {
}
}
-int restore_check_mode(const char* udid) {
+int restore_check_mode(struct idevicerestore_client_t* client) {
char* type = NULL;
uint64_t version = 0;
idevice_t device = NULL;
@@ -96,7 +96,7 @@ int restore_check_mode(const char* udid) {
idevice_error_t device_error = IDEVICE_E_SUCCESS;
restored_error_t restore_error = RESTORE_E_SUCCESS;
- device_error = idevice_new(&device, udid);
+ device_error = idevice_new(&device, client->udid);
if (device_error != IDEVICE_E_SUCCESS) {
return -1;
}
@@ -121,7 +121,7 @@ int restore_check_mode(const char* udid) {
return 0;
}
-int restore_check_device(const char* udid) {
+int restore_check_device(struct idevicerestore_client_t* client) {
int i = 0;
char* type = NULL;
char* model = NULL;
@@ -132,7 +132,7 @@ int restore_check_device(const char* udid) {
idevice_error_t device_error = IDEVICE_E_SUCCESS;
restored_error_t restore_error = RESTORE_E_SUCCESS;
- device_error = idevice_new(&device, udid);
+ device_error = idevice_new(&device, client->udid);
if (device_error != IDEVICE_E_SUCCESS) {
return -1;
}
diff --git a/src/restore.h b/src/restore.h
index 6e9c96e..7ad0d9f 100644
--- a/src/restore.h
+++ b/src/restore.h
@@ -40,8 +40,8 @@ struct restore_client_t {
restored_client_t client;
};
-int restore_check_mode(const char* udid);
-int restore_check_device(const char* udid);
+int restore_check_mode(struct idevicerestore_client_t* client);
+int restore_check_device(struct idevicerestore_client_t* client);
int restore_client_new(struct idevicerestore_client_t* client);
void restore_client_free(struct idevicerestore_client_t* client);
int restore_reboot(struct idevicerestore_client_t* client);