summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-as/llvm-as.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp
index d6d850139b..9e9290d2cc 100644
--- a/tools/llvm-as/llvm-as.cpp
+++ b/tools/llvm-as/llvm-as.cpp
@@ -73,7 +73,8 @@ int main(int argc, char **argv) {
<< "Use -f command line argument to force output\n";
return 1;
}
- Out = new std::ofstream(OutputFilename.c_str());
+ Out = new std::ofstream(OutputFilename.c_str(), std::ios_base::out |
+ std::ios_base::trunc | std::ios_base::binary);
} else { // Specified stdout
Out = &std::cout;
}
@@ -100,7 +101,8 @@ int main(int argc, char **argv) {
return 1;
}
- Out = new std::ofstream(OutputFilename.c_str());
+ Out = new std::ofstream(OutputFilename.c_str(), std::ios_base::out |
+ std::ios_base::trunc | std::ios_base::binary);
// Make sure that the Out file gets unlinked from the disk if we get a
// SIGINT
RemoveFileOnSignal(OutputFilename);