aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2017-03-01 21:19:46 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-01 21:19:46 +0000
commitb76d73d620425b630242ceca60d9d334a08cfe65 (patch)
treee47a7e88d56960f5721ec1719e54e6fb6c0071f1
parentd552f0b27a40334faf941aa2500f6d62fe3bdcee (diff)
parent8bad64c4073daa7e7b6f634e9a39790f54b52f9c (diff)
downloadplatform_external_libbrillo-b76d73d620425b630242ceca60d9d334a08cfe65.tar.gz
platform_external_libbrillo-b76d73d620425b630242ceca60d9d334a08cfe65.tar.bz2
platform_external_libbrillo-b76d73d620425b630242ceca60d9d334a08cfe65.zip
Don't crash if /oem/os-release.d/product_id does not exist.
am: 8bad64c407 Change-Id: I49c339a37263422aa7f43ba3314a498f650cf17e
-rw-r--r--brillo/osrelease_reader.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/brillo/osrelease_reader.cc b/brillo/osrelease_reader.cc
index 6e4bf90..c8f660e 100644
--- a/brillo/osrelease_reader.cc
+++ b/brillo/osrelease_reader.cc
@@ -41,9 +41,8 @@ void OsReleaseReader::Load(const base::FilePath& root_dir) {
path = enumerator.Next()) {
std::string content;
if (!base::ReadFileToString(path, &content)) {
- // The only way to fail is if a file exist in /etc/os-release.d but we
- // cannot read it.
- PLOG(FATAL) << "Could not read " << path.value();
+ PLOG(ERROR) << "Could not read " << path.value();
+ continue;
}
// There might be a trailing new line. Strip it to keep only the first line
// of the file.