diff options
author | Yabin Cui <yabinc@google.com> | 2016-01-15 15:25:48 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2016-01-15 18:22:11 -0800 |
commit | ffaa912ca48e87d25d516780c15cdd7c50de43db (patch) | |
tree | a6879279252062e3242aeb2fddfde2f1c195f8b7 /simpleperf/record_file_reader.cpp | |
parent | f1b30da793ce64bb29364c1f8f0ab2f5817d03df (diff) | |
download | extras-ffaa912ca48e87d25d516780c15cdd7c50de43db.tar.gz |
Simpleperf: support build for windows.
Change-Id: I31554f36ee97eb0ae27bda9b77e29410776925e2
Diffstat (limited to 'simpleperf/record_file_reader.cpp')
-rw-r--r-- | simpleperf/record_file_reader.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/simpleperf/record_file_reader.cpp b/simpleperf/record_file_reader.cpp index 0ee5c216..1befc69f 100644 --- a/simpleperf/record_file_reader.cpp +++ b/simpleperf/record_file_reader.cpp @@ -18,8 +18,6 @@ #include <fcntl.h> #include <string.h> -#include <sys/mman.h> -#include <unistd.h> #include <set> #include <vector> @@ -32,7 +30,8 @@ using namespace PerfFileFormat; std::unique_ptr<RecordFileReader> RecordFileReader::CreateInstance(const std::string& filename) { - FILE* fp = fopen(filename.c_str(), "reb"); + std::string mode = std::string("rb") + CLOSE_ON_EXEC_MODE; + FILE* fp = fopen(filename.c_str(), mode.c_str()); if (fp == nullptr) { PLOG(ERROR) << "failed to open record file '" << filename << "'"; return nullptr; |