commit | fc24b378812964966553dc875975fc6467df7137 | [log] [tgz] |
---|---|---|
author | Alice Wang <aliceywang@google.com> | Thu Jul 28 16:45:42 2022 +0000 |
committer | Alice Wang <aliceywang@google.com> | Thu Jul 28 16:45:42 2022 +0000 |
tree | e28e95ff99e378303753a54975ca869c5224b3b7 | |
parent | 97e85fc0b74e979c012bd2968a656976265c8d84 [diff] |
Add O_CLOEXEC flag when opening file This fixes a buid warning in aosp/2163081. Test: atest MicrodroidBenchmarks Change-Id: I52128a56c9ed3427d029828e9a63ec695192131a
diff --git a/tests/benchmark/src/native/benchmarkbinary.cpp b/tests/benchmark/src/native/benchmarkbinary.cpp index 6a5b764..5523579 100644 --- a/tests/benchmark/src/native/benchmarkbinary.cpp +++ b/tests/benchmark/src/native/benchmarkbinary.cpp
@@ -68,7 +68,7 @@ char buf[kBlockSizeBytes]; clock_t start = clock(); - unique_fd fd(open(filename.c_str(), O_RDONLY)); + unique_fd fd(open(filename.c_str(), O_RDONLY | O_CLOEXEC)); if (fd.get() == -1) { return ErrnoError() << "Read: opening " << filename << " failed"; }