Skip to content

Commit

Permalink
restore: Improve checkpoint log output again, make sure to always che…
Browse files Browse the repository at this point in the history
…ck for errors

Turns out even with a CHECKPOINT_RESULT of 0 we can still have a
CHECKPOINT_ERROR string.
  • Loading branch information
nikias committed Oct 4, 2023
1 parent 1405a9f commit 7e5860d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -4465,11 +4465,14 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
plist_get_bool_val(node, &ckpt_complete);
}

info("Checkpoint %s id: 0x%" PRIX64 " (%s)\n", (ckpt_complete) ? "completed" : "started ", ckpt_id, ckpt_name);
if (ckpt_res != 0) {
node = plist_dict_get_item(message, "CHECKPOINT_ERROR");
const char* ckpt_error = (node) ? plist_get_string_ptr(node, NULL) : "(unknown)";
info("Checkpoint FAILED id: 0x%" PRIX64 " error %"PRIi64": %s\n", ckpt_id, ckpt_res, ckpt_error);
if (ckpt_complete) {
info("Checkpoint completed id: 0x%" PRIX64 " (%s) result=%" PRIi64 "\n", ckpt_id, ckpt_name, ckpt_res);
} else {
info("Checkpoint started id: 0x%" PRIX64 " (%s)\n", ckpt_id, ckpt_name);
}
node = plist_dict_get_item(message, "CHECKPOINT_ERROR");
if (node) {
info("Checkpoint FAILURE id: 0x%" PRIX64 " result=%" PRIi64 ": %s\n", ckpt_id, ckpt_res, plist_get_string_ptr(node, NULL));
}
}

Expand Down

0 comments on commit 7e5860d

Please sign in to comment.