aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2010-01-29 19:22:48 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2010-01-29 19:22:48 +0000
commit8f13e6625bfac838c9dbf9a16d0140d30e421312 (patch)
tree863b39ddc3447f43cf23cb10b351e938394989a1
parentc1bd6750d435126c85f2fe6e2dc9c58c97c96080 (diff)
downloadpaludis-8f13e6625bfac838c9dbf9a16d0140d30e421312.tar.gz
paludis-8f13e6625bfac838c9dbf9a16d0140d30e421312.tar.xz
Use one stream for both stdout and stderr
-rw-r--r--paludis/file_output_manager.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/paludis/file_output_manager.cc b/paludis/file_output_manager.cc
index 75ff585..788e20b 100644
--- a/paludis/file_output_manager.cc
+++ b/paludis/file_output_manager.cc
@@ -36,8 +36,7 @@ namespace paludis
struct Implementation<FileOutputManager>
{
FSEntry filename;
- std::tr1::shared_ptr<SafeOFStream> stdout_stream;
- std::tr1::shared_ptr<SafeOFStream> stderr_stream;
+ std::tr1::shared_ptr<SafeOFStream> stream;
const bool keep_on_success, keep_on_empty;
const std::tr1::shared_ptr<OutputManager> summary_output_manager;
const std::string summary_output_message;
@@ -52,8 +51,7 @@ namespace paludis
const std::string & s
) :
filename(o),
- stdout_stream(new SafeOFStream(filename)),
- stderr_stream(new SafeOFStream(filename)),
+ stream(new SafeOFStream(filename)),
keep_on_success(k),
keep_on_empty(l),
summary_output_manager(m),
@@ -87,13 +85,13 @@ FileOutputManager::~FileOutputManager()
std::ostream &
FileOutputManager::stdout_stream()
{
- return *_imp->stdout_stream;
+ return *_imp->stream;
}
std::ostream &
FileOutputManager::stderr_stream()
{
- return *_imp->stderr_stream;
+ return *_imp->stream;
}
void
@@ -131,14 +129,11 @@ FileOutputManager::nothing_more_to_come()
{
_imp->nothing_more_to_come = true;
- if (! _imp->stdout_stream)
+ if (! _imp->stream)
return;
- *_imp->stdout_stream << std::flush;
- _imp->stdout_stream.reset();
-
- *_imp->stderr_stream << std::flush;
- _imp->stderr_stream.reset();
+ *_imp->stream << std::flush;
+ _imp->stream.reset();
if (! _imp->keep_on_empty)
{