summaryrefslogtreecommitdiff
path: root/init/init_parser.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-05-04 18:17:33 -0700
committerTom Cherry <tomcherry@google.com>2017-05-05 14:37:12 -0700
commit2cbbe9f7a35efdc94e8e34ef92eb6f70a85887fe (patch)
tree215ecac00aa47fbac652e5e7bc99761176884b84 /init/init_parser.cpp
parent517e1f17cfec2143d4d10a64b1496a550acf3ea2 (diff)
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
Diffstat (limited to 'init/init_parser.cpp')
-rw-r--r--init/init_parser.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}