From 2cbbe9f7a35efdc94e8e34ef92eb6f70a85887fe Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 4 May 2017 18:17:33 -0700 Subject: init: do not log directly from read_file() and write_file() Their callers may be able to add more context, so use an error string to record the error. Bug: 38038887 Test: boot bullhead Test: Init unit tests Change-Id: I46690d1c66e00a4b15cadc6fd0d6b50e990388c3 --- init/init_parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'init/init_parser.cpp') diff --git a/init/init_parser.cpp b/init/init_parser.cpp index 620367a62..1b31cf223 100644 --- a/init/init_parser.cpp +++ b/init/init_parser.cpp @@ -110,7 +110,9 @@ bool Parser::ParseConfigFile(const std::string& path) { LOG(INFO) << "Parsing file " << path << "..."; Timer t; std::string data; - if (!read_file(path, &data)) { + std::string err; + if (!ReadFile(path, &data, &err)) { + LOG(ERROR) << err; return false; } -- cgit v1.2.3