summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2019-05-22 08:23:31 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-05-22 08:23:31 +0000
commitdb2353c143c16aa91b5321175a2d102699c94e6e (patch)
tree2121df3b97f639bfbc238cd9812444747659bb5e
parent94e52502dc4e10d4d12b7faef5f9d2c6a18684cc (diff)
parent73f70b467f0deb913343ea72c023e45d10f5dc5b (diff)
Merge "Treating all FileSection files as device specific."
-rw-r--r--cmds/incidentd/src/Section.cpp4
-rw-r--r--cmds/incidentd/tests/Section_test.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp
index bb5221c7404c..f19f8365c85e 100644
--- a/cmds/incidentd/src/Section.cpp
+++ b/cmds/incidentd/src/Section.cpp
@@ -255,7 +255,9 @@ status_t FileSection::Execute(ReportRequestSet* requests) const {
unique_fd fd(open(mFilename, O_RDONLY | O_CLOEXEC));
if (fd.get() == -1) {
ALOGW("FileSection '%s' failed to open file", this->name.string());
- return this->deviceSpecific ? NO_ERROR : -errno;
+ // There may be some devices/architectures that won't have the file.
+ // Just return here without an error.
+ return NO_ERROR;
}
FdBuffer buffer;
diff --git a/cmds/incidentd/tests/Section_test.cpp b/cmds/incidentd/tests/Section_test.cpp
index 3c338b3a36c8..5d2f38d927d7 100644
--- a/cmds/incidentd/tests/Section_test.cpp
+++ b/cmds/incidentd/tests/Section_test.cpp
@@ -145,7 +145,7 @@ TEST_F(SectionTest, FileSection) {
TEST_F(SectionTest, FileSectionNotExist) {
FileSection fs1(NOOP_PARSER, "notexist", false, QUICK_TIMEOUT_MS);
- ASSERT_EQ(NAME_NOT_FOUND, fs1.Execute(&requests));
+ ASSERT_EQ(NO_ERROR, fs1.Execute(&requests));
FileSection fs2(NOOP_PARSER, "notexist", true, QUICK_TIMEOUT_MS);
ASSERT_EQ(NO_ERROR, fs2.Execute(&requests));