From 3b010bc393b773e4efc6f353352459386c80ca8c Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Wed, 9 Dec 2015 15:29:45 -0800 Subject: updater: Output msg when recovery is called Output messages in log when recovery is attempted or succeeded during incremental OTA update. Change-Id: I4033df7ae3aaecbc61921d5337eda26f79164fda (cherry picked from commit b686ba211443490111729ba9d82eb0c0b305e185) --- updater/blockimg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index 50067d479..3b26f057a 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -1670,6 +1670,9 @@ Value* BlockImageRecoverFn(const char* name, State* state, int argc, Expr* argv[ return StringValue(strdup("")); } + // Output notice to log when recover is attempted + fprintf(stderr, "%s image corrupted, attempting to recover...\n", filename->data); + // When opened with O_RDWR, libfec rewrites corrupted blocks when they are read fec::io fh(filename->data, O_RDWR); @@ -1720,7 +1723,7 @@ Value* BlockImageRecoverFn(const char* name, State* state, int argc, Expr* argv[ // read and check if the errors field value has increased. } } - + fprintf(stderr, "...%s image recovered successfully.\n", filename->data); return StringValue(strdup("t")); } -- cgit v1.2.3