Merge "Add O_CLOEXEC flag when opening file" am: 23dda63069

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/2168822

Change-Id: I0a6bd3f79531302c46c012de34a8ff4d315feed2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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";
         }