Skip to content
Snippets Groups Projects
Commit fc24b378 authored by Alice Wang's avatar Alice Wang
Browse files

Add O_CLOEXEC flag when opening file

This fixes a buid warning in aosp/2163081.

Test: atest MicrodroidBenchmarks
Change-Id: I52128a56c9ed3427d029828e9a63ec695192131a
parent 97e85fc0
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ private:
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";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment