diff options
author | Sen Jiang <senj@google.com> | 2017-03-01 21:24:39 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-01 21:24:39 +0000 |
commit | 69f25ed7d17a0d9dc39223f4a91b0341d7d6e158 (patch) | |
tree | e47a7e88d56960f5721ec1719e54e6fb6c0071f1 | |
parent | 42fda8c6a8defe1c84a80a777a0b7c78bbe2f2b2 (diff) | |
parent | a9fb868de7a886076b173333e7a269a2985dd41e (diff) | |
download | platform_external_libbrillo-69f25ed7d17a0d9dc39223f4a91b0341d7d6e158.tar.gz platform_external_libbrillo-69f25ed7d17a0d9dc39223f4a91b0341d7d6e158.tar.bz2 platform_external_libbrillo-69f25ed7d17a0d9dc39223f4a91b0341d7d6e158.zip |
Don't crash if /oem/os-release.d/product_id does not exist. am: 8bad64c407 am: b76d73d620
am: a9fb868de7
Change-Id: I5342ee92def41c8a114cdc1ca7dda51adade2e40
-rw-r--r-- | brillo/osrelease_reader.cc | 5 |
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. |