diff options
author | Martin Szulecki | 2012-07-17 18:42:30 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 18:42:30 +0200 |
commit | fc4cf3528bce2b04d12bc41fd97fc8d481daca4e (patch) | |
tree | 22ab15e8c16b298f48cefcb500dcd34384e8718e /src | |
parent | 8103f15cd9df4651d3bfdf63c9df308f134c22f0 (diff) | |
download | idevicerestore-fc4cf3528bce2b04d12bc41fd97fc8d481daca4e.tar.gz idevicerestore-fc4cf3528bce2b04d12bc41fd97fc8d481daca4e.tar.bz2 |
restore: If opening a device times out completely, make error unrecoverable
Diffstat (limited to 'src')
-rw-r--r-- | src/restore.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/restore.c b/src/restore.c index d396c7f..56179d0 100644 --- a/src/restore.c +++ b/src/restore.c @@ -419,7 +419,7 @@ int restore_open_with_timeout(struct idevicerestore_client_t* client) { if (!restore_device_connected) { error("ERROR: Unable to connect to device in restore mode\n"); - return -1; + return (i == attempts ? -2:-1); } info("Connecting now...\n"); @@ -1457,9 +1457,10 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit restore_finished = 0; // open our connection to the device and verify we're in restore mode - if (restore_open_with_timeout(client) < 0) { + error = restore_open_with_timeout(client); + if (error < 0) { error("ERROR: Unable to open device in restore mode\n"); - return -2; + return (error == -2) ? -1: -2; } info("Device has successfully entered restore mode\n"); |