diff options
author | Steve Reinhardt <stever@gmail.com> | 2007-08-03 03:51:30 -0400 |
---|---|---|
committer | Steve Reinhardt <stever@gmail.com> | 2007-08-03 03:51:30 -0400 |
commit | 3afc6259757e8ec688701bf3e3d7fcdad28d5b6c (patch) | |
tree | 35c0e1ebb596dfe94934fc0f5f064eb523b3013b /src/base/output.cc | |
parent | 62aa1d7f559622dcb04b1b2fe1e2ecec375883a3 (diff) | |
parent | 121a894ce0d551e860392f9aa6bd381329a25b96 (diff) | |
download | gem5-3afc6259757e8ec688701bf3e3d7fcdad28d5b6c.tar.xz |
merge from head
--HG--
extra : convert_revision : 21f7afe2719c00744c0981212c1ee6e442238e01
Diffstat (limited to 'src/base/output.cc')
-rw-r--r-- | src/base/output.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/base/output.cc b/src/base/output.cc index afcac03a5..9d02a4a71 100644 --- a/src/base/output.cc +++ b/src/base/output.cc @@ -87,7 +87,7 @@ OutputDirectory::resolve(const string &name) } ostream * -OutputDirectory::create(const string &name) +OutputDirectory::create(const string &name, bool binary) { if (name == "cerr" || name == "stderr") return &cerr; @@ -95,7 +95,8 @@ OutputDirectory::create(const string &name) if (name == "cout" || name == "stdout") return &cout; - ofstream *file = new ofstream(resolve(name).c_str(), ios::trunc); + ofstream *file = new ofstream(resolve(name).c_str(), + ios::trunc | binary ? ios::binary : (ios::openmode)0); if (!file->is_open()) panic("Cannot open file %s", name); |