From 6d99d4b4571b95ff221439c819826381f8bb96f9 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 25 Apr 2018 16:47:04 -0700 Subject: recovery: Split main() into recovery_main.cpp. This prepares for moving more codes from recovery into librecovery, so that they will become more easily testable. recovery_main.cpp will be the source code for recovery module, with the rest moved into librecovery. recovery_main.cpp mainly does the initializations, such as setting up the logger. Test: mmma -j bootable/recovery Test: recovery_component_test Test: Build and boot into recovery image on marlin. Change-Id: I8e846524546b6f3f0e32ed869e851f62261eef23 Merged-In: I8e846524546b6f3f0e32ed869e851f62261eef23 --- common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'common.h') diff --git a/common.h b/common.h index 4228e71de..33c5ba08f 100644 --- a/common.h +++ b/common.h @@ -37,9 +37,13 @@ extern std::string stage; // The reason argument provided in "--reason=". extern const char* reason; -// fopen a file, mounting volumes and making parent dirs as necessary. +// fopen(3)'s the given file, by mounting volumes and making parent dirs as necessary. Returns the +// file pointer, or nullptr on error. FILE* fopen_path(const std::string& path, const char* mode); +// In turn fflush(3)'s, fsync(3)'s and fclose(3)'s the given stream. +void check_and_fclose(FILE* fp, const std::string& name); + void ui_print(const char* format, ...) __printflike(1, 2); bool is_ro_debuggable(); -- cgit v1.2.3