From 7e5860d249441d0b45e50de2b46475432e3fc908 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 4 Oct 2023 14:39:20 +0200 Subject: [PATCH] restore: Improve checkpoint log output again, make sure to always check for errors Turns out even with a CHECKPOINT_RESULT of 0 we can still have a CHECKPOINT_ERROR string. --- src/restore.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/restore.c b/src/restore.c index 320d5f06..26a93a02 100644 --- a/src/restore.c +++ b/src/restore.c @@ -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)); } }