Add kTruncate in FileBase. BUG=6841435.
And remove O_TRUNC from the default flags to OutputFile.
Change-Id: Id2ff6d5bac319d8be498e438eb3ef84e85573218
diff --git a/tools/bcc/Main.cpp b/tools/bcc/Main.cpp
index 44da31c..585dda0 100644
--- a/tools/bcc/Main.cpp
+++ b/tools/bcc/Main.cpp
@@ -265,7 +265,7 @@
bool CompileScript(Compiler &pCompiler, Script &pScript,
const std::string &pOutputPath) {
// Open the output file.
- OutputFile output_file(pOutputPath);
+ OutputFile output_file(pOutputPath, FileBase::kTruncate);
if (output_file.hasError()) {
llvm::errs() << "Failed to open the output file `" << pOutputPath