diff options
author | Tom Cherry <tomcherry@google.com> | 2017-05-04 18:17:33 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-05-05 14:37:12 -0700 |
commit | 2cbbe9f7a35efdc94e8e34ef92eb6f70a85887fe (patch) | |
tree | 215ecac00aa47fbac652e5e7bc99761176884b84 /init/property_service.cpp | |
parent | 517e1f17cfec2143d4d10a64b1496a550acf3ea2 (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/property_service.cpp')
-rw-r--r-- | init/property_service.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp index 6f40d1ce0..e01cd0b4b 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -510,8 +510,9 @@ static void load_properties(char *data, const char *filter) static void load_properties_from_file(const char* filename, const char* filter) { Timer t; std::string data; - if (!read_file(filename, &data)) { - PLOG(WARNING) << "Couldn't load properties from " << filename; + std::string err; + if (!ReadFile(filename, &data, &err)) { + PLOG(WARNING) << "Couldn't load property file: " << err; return; } data.push_back('\n'); |