Add missing report of error code under recovery

Add report of kMapFileFailure, kForkUpdateBinaryFailure and
kUpdateBinaryCommandFailure.

Test: unit test pass; kMapFileFailure reports correctly.
Change-Id: I858c81b6c750b5e300b1b12760b1f0fa8e23b47d
diff --git a/error_code.h b/error_code.h
index 4cbad4c..4e3032b 100644
--- a/error_code.h
+++ b/error_code.h
@@ -25,6 +25,9 @@
   kBootreasonInBlacklist,
   kPackageCompatibilityFailure,
   kScriptExecutionFailure,
+  kMapFileFailure,
+  kForkUpdateBinaryFailure,
+  kUpdateBinaryCommandFailure,
 };
 
 enum CauseCode {
diff --git a/install.cpp b/install.cpp
index 7fbf5c0..80ef715 100644
--- a/install.cpp
+++ b/install.cpp
@@ -321,6 +321,7 @@
   if (ret) {
     close(pipefd[0]);
     close(pipefd[1]);
+    log_buffer->push_back(android::base::StringPrintf("error: %d", kUpdateBinaryCommandFailure));
     return ret;
   }
 
@@ -385,6 +386,7 @@
     close(pipefd[0]);
     close(pipefd[1]);
     PLOG(ERROR) << "Failed to fork update binary";
+    log_buffer->push_back(android::base::StringPrintf("error: %d", kForkUpdateBinaryFailure));
     return INSTALL_ERROR;
   }
 
@@ -573,6 +575,7 @@
   MemMapping map;
   if (!map.MapFile(path)) {
     LOG(ERROR) << "failed to map file";
+    log_buffer->push_back(android::base::StringPrintf("error: %d", kMapFileFailure));
     return INSTALL_CORRUPT;
   }