summaryrefslogtreecommitdiff
path: root/cmds/incident_helper
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2017-08-14 18:29:21 -0700
committerGeorge Burgess IV <gbiv@google.com>2017-08-14 18:55:40 -0700
commitf4160311dde8e4b76107ab72f9dd45f4077fb096 (patch)
treebdd0f4aea3a9dcd0a5de3e201ca1c52be8cd90f8 /cmds/incident_helper
parent677e8d24c8ca75b730de3895cd6c76784a96f457 (diff)
Remove useless open modes
Previously, the machinery that detected these was only enabled in optimized builds. We're expanding it to work in code built with -O0, as well. Thus, we now get compile-time warnings about these calls (which get turned into errors by -Werror). Bug: 12231437 Test: Builds without warnings about useless mode bits in calls to open() Change-Id: Icb1bc5f0a7941bb90d8581d6c3bde7cc076f3e01
Diffstat (limited to 'cmds/incident_helper')
-rw-r--r--cmds/incident_helper/tests/IncidentHelper_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmds/incident_helper/tests/IncidentHelper_test.cpp b/cmds/incident_helper/tests/IncidentHelper_test.cpp
index 04109c9a3ecd..04dd8de11a15 100644
--- a/cmds/incident_helper/tests/IncidentHelper_test.cpp
+++ b/cmds/incident_helper/tests/IncidentHelper_test.cpp
@@ -97,7 +97,7 @@ TEST_F(IncidentHelperTest, KernelWakesParser) {
record2->set_last_change(2067286206l);
record2->set_prevent_suspend_time(0l);
- int fd = open(testFile.c_str(), O_RDONLY, 0444);
+ int fd = open(testFile.c_str(), O_RDONLY);
ASSERT_TRUE(fd != -1);
CaptureStdout();
@@ -149,7 +149,7 @@ TEST_F(IncidentHelperTest, ProcrankParser) {
expected.mutable_summary()->mutable_ram()
->set_raw_text("3843972K total, 281424K free, 116764K buffers, 1777452K cached, 1136K shmem, 217916K slab");
- int fd = open(testFile.c_str(), O_RDONLY, 0444);
+ int fd = open(testFile.c_str(), O_RDONLY);
ASSERT_TRUE(fd != -1);
CaptureStdout();
@@ -187,11 +187,11 @@ TEST_F(IncidentHelperTest, ProcrankParserShortHeader) {
expected.mutable_summary()->mutable_ram()
->set_raw_text("3843972K total, 281424K free, 116764K buffers, 1777452K cached, 1136K shmem, 217916K slab");
- int fd = open(testFile.c_str(), O_RDONLY, 0444);
+ int fd = open(testFile.c_str(), O_RDONLY);
ASSERT_TRUE(fd != -1);
CaptureStdout();
ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO));
EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected));
close(fd);
-} \ No newline at end of file
+}