Merge "Log failed load_properties_from_file calls." am: 57513bd5a3 am: 9abb85ebe0 am: 6d60731271
am: 5c54bb548a
Change-Id: Ie392c70cd6117fcdb7f36dd0bd77f59f56e846bc
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 9e13733..1e569af 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -376,17 +376,17 @@
}
}
-/*
- * Filter is used to decide which properties to load: NULL loads all keys,
- * "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match.
- */
+// Filter is used to decide which properties to load: NULL loads all keys,
+// "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match.
static void load_properties_from_file(const char* filename, const char* filter) {
Timer t;
std::string data;
- if (read_file(filename, &data)) {
- data.push_back('\n');
- load_properties(&data[0], filter);
+ if (!read_file(filename, &data)) {
+ PLOG(WARNING) << "Couldn't load properties from " << filename;
+ return;
}
+ data.push_back('\n');
+ load_properties(&data[0], filter);
LOG(VERBOSE) << "(Loading properties from " << filename << " took " << t.duration() << "s.)";
}