diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2005-01-22 17:36:17 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2005-01-22 17:36:17 +0000 |
commit | 5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b (patch) | |
tree | 1a699df0388afa1ed3d3acc4e4cd91085adbed10 /tools/gccas/gccas.cpp | |
parent | 695c9bdbd0ad9d540dea68e201cd616afb4320d4 (diff) |
Use binary mode for reading/writing bytecode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccas/gccas.cpp')
-rw-r--r-- | tools/gccas/gccas.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp index deb9397fec..83de4ebe25 100644 --- a/tools/gccas/gccas.cpp +++ b/tools/gccas/gccas.cpp @@ -164,9 +164,12 @@ int main(int argc, char **argv) { } if (OutputFilename == "-") + // FIXME: cout is not binary! Out = &std::cout; else { - Out = new std::ofstream(OutputFilename.c_str(), std::ios::out); + std::ios::openmode io_mode = std::ios::out | std::ios::trunc | + std::ios::binary; + Out = new std::ofstream(OutputFilename.c_str(), io_mode); // Make sure that the Out file gets unlinked from the disk if we get a // signal |