summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/restore.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/restore.c b/src/restore.c
index ca0e4e1..2280095 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1601,6 +1601,13 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
// this is the restore process loop, it reads each message in from
// restored and passes that data on to it's specific handler
while ((client->flags & FLAG_QUIT) == 0) {
+ // finally, if any of these message handlers returned -1 then we encountered
+ // an unrecoverable error, so we need to bail.
+ if (error < 0) {
+ error("ERROR: Unable to successfully restore device\n");
+ client->flags |= FLAG_QUIT;
+ }
+
restore_error = restored_receive(restore, &message);
if (restore_error != RESTORE_E_SUCCESS) {
debug("No data to read\n");
@@ -1660,13 +1667,6 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
debug_plist(message);
}
- // finally, if any of these message handlers returned -1 then we encountered
- // an unrecoverable error, so we need to bail.
- if (error < 0) {
- error("ERROR: Unable to successfully restore device\n");
- client->flags |= FLAG_QUIT;
- }
-
plist_free(message);
message = NULL;
}