summaryrefslogtreecommitdiff
path: root/lib/profile
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-12-15 22:18:11 +0000
committerXinliang David Li <davidxl@google.com>2015-12-15 22:18:11 +0000
commit1597fbe985e7e5ea47dabde03004bf32fbb34014 (patch)
tree23203c0226b26107a0d1ee40e1864968ceb9bb27 /lib/profile
parentf6ee19d8cd0d7bf52fbd6994c162622b74580054 (diff)
[PGO] Open file with explict binary mode
Patch by: Johan Engelen On windows, opening in text mode will result in line ending chars to be appended leading to profile corruption. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile')
-rw-r--r--lib/profile/InstrProfilingFile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c
index 35a3b48db..4fc769334 100644
--- a/lib/profile/InstrProfilingFile.c
+++ b/lib/profile/InstrProfilingFile.c
@@ -46,7 +46,7 @@ static int writeFileWithName(const char *OutputName) {
return -1;
/* Append to the file to support profiling multiple shared objects. */
- OutputFile = fopen(OutputName, "a");
+ OutputFile = fopen(OutputName, "ab");
if (!OutputFile)
return -1;