summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-07-08 19:12:56 +0200
committerGravatar Martin Szulecki2010-07-08 19:12:56 +0200
commita92e3de475368eea3c01372ce37d758a35e2a290 (patch)
treef74eeebf2e51b25da4a5e39a89e75491fbeaae37
parent0a07525af88d5b6522809595d4c5e1eb2a6e022c (diff)
downloadidevicerestore-a92e3de475368eea3c01372ce37d758a35e2a290.tar.gz
idevicerestore-a92e3de475368eea3c01372ce37d758a35e2a290.tar.bz2
Do not attempt to open another recovery session if one exists
-rw-r--r--src/recovery.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/recovery.c b/src/recovery.c
index 4240817..233224a 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -352,8 +352,10 @@ int recovery_get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid) {
int recovery_get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid) {
irecv_error_t recovery_error = IRECV_E_SUCCESS;
- if (recovery_open_with_timeout(client) < 0) {
- return -1;
+ if(client->recovery == NULL) {
+ if (recovery_open_with_timeout(client) < 0) {
+ return -1;
+ }
}
recovery_error = irecv_get_cpid(client->recovery->client, cpid);
@@ -367,8 +369,10 @@ int recovery_get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid) {
int recovery_get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid) {
irecv_error_t recovery_error = IRECV_E_SUCCESS;
- if (recovery_open_with_timeout(client) < 0) {
- return -1;
+ if(client->recovery == NULL) {
+ if (recovery_open_with_timeout(client) < 0) {
+ return -1;
+ }
}
recovery_error = irecv_get_bdid(client->recovery->client, bdid);