diff options
author | Martin Szulecki | 2012-07-17 18:54:02 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 18:54:02 +0200 |
commit | ae3719ec5878c5fa23a2cddec1aac07b74ddb429 (patch) | |
tree | 72696a32487bb81d7e93625c53b1033dfbd11c5b /src/restore.c | |
parent | 1c9047e6f3ebe76a71eab1b9fcca03c0432f84b7 (diff) | |
download | idevicerestore-ae3719ec5878c5fa23a2cddec1aac07b74ddb429.tar.gz idevicerestore-ae3719ec5878c5fa23a2cddec1aac07b74ddb429.tar.bz2 |
restore: Handle printing logs of a StatusMsg if available
Diffstat (limited to 'src/restore.c')
-rw-r--r-- | src/restore.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/restore.c b/src/restore.c index 25d51f6..ca0e4e1 100644 --- a/src/restore.c +++ b/src/restore.c @@ -562,8 +562,10 @@ int restore_handle_progress_msg(restored_client_t client, plist_t msg) { int restore_handle_status_msg(restored_client_t client, plist_t msg) { int result = 0; uint64_t value = 0; + char* log = NULL; info("Got status message\n"); + // read status code plist_t node = plist_dict_get_item(msg, "Status"); plist_get_uint_val(node, &value); @@ -587,12 +589,22 @@ int restore_handle_status_msg(restored_client_t client, plist_t msg) { break; } + // read error code node = plist_dict_get_item(msg, "AMRError"); if (node && plist_get_node_type(node) == PLIST_UINT) { plist_get_uint_val(node, &value); result = -value; } + // check if log is available + node = plist_dict_get_item(msg, "Log"); + if (node && plist_get_node_type(node) == PLIST_STRING) { + plist_get_string_val(node, &log); + info("Log is available:\n%s\n", log); + free(log); + log = NULL; + } + return result; } |