aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-13 16:07:51 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-13 16:07:51 +0000
commit7a4f916615342108ec72e9631982c71b5b8b36e3 (patch)
tree1da259a3e6561a1433d1e37443fd54fc2b1c72f2
parenta7cc5075fe92a40600abe338801e293727f99c15 (diff)
downloadpaludis-7a4f916615342108ec72e9631982c71b5b8b36e3.tar.gz
paludis-7a4f916615342108ec72e9631982c71b5b8b36e3.tar.xz
Make TeeOutputStream flush
-rw-r--r--paludis/util/tee_output_stream.cc9
-rw-r--r--paludis/util/tee_output_stream.hh2
2 files changed, 11 insertions, 0 deletions
diff --git a/paludis/util/tee_output_stream.cc b/paludis/util/tee_output_stream.cc
index 3289968..d179318 100644
--- a/paludis/util/tee_output_stream.cc
+++ b/paludis/util/tee_output_stream.cc
@@ -50,6 +50,15 @@ TeeOutputStreamBuf::overflow(int_type c)
return c;
}
+int
+TeeOutputStreamBuf::sync()
+{
+ for (std::list<std::ostream *>::iterator i(_imp->streams.begin()), i_end(_imp->streams.end()) ;
+ i != i_end ; ++i)
+ **i << std::flush;
+ return 0;
+}
+
std::streamsize
TeeOutputStreamBuf::xsputn(const char * s, std::streamsize num)
{
diff --git a/paludis/util/tee_output_stream.hh b/paludis/util/tee_output_stream.hh
index c464e97..cf01bee 100644
--- a/paludis/util/tee_output_stream.hh
+++ b/paludis/util/tee_output_stream.hh
@@ -35,6 +35,8 @@ namespace paludis
virtual int_type
overflow(int_type c);
+ virtual int sync();
+
virtual std::streamsize
xsputn(const char * s, std::streamsize num);