From fc4cf3528bce2b04d12bc41fd97fc8d481daca4e Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 17 Jul 2012 18:42:30 +0200 Subject: restore: If opening a device times out completely, make error unrecoverable --- src/restore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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"); -- cgit v1.1-32-gdbae