diff options
author | 2013-04-26 17:46:12 +0200 | |
---|---|---|
committer | 2013-05-03 22:54:13 +0200 | |
commit | f229e6b71de24d65caea010053f0650d53bece01 (patch) | |
tree | bf12853cd9ecf8a54ab7852ab7c15034e76509c1 | |
parent | ab1f3d486986148560158e38640f8258d25881a3 (diff) | |
download | paludis-f229e6b71de24d65caea010053f0650d53bece01.tar.gz paludis-f229e6b71de24d65caea010053f0650d53bece01.tar.xz |
Use StreamHolder
-rw-r--r-- | paludis/util/process.cc | 4 | ||||
-rw-r--r-- | paludis/util/safe_ofstream.cc | 4 | ||||
-rw-r--r-- | paludis/util/safe_ofstream.hh | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/paludis/util/process.cc b/paludis/util/process.cc index ff0cf5a3d..48bb92841 100644 --- a/paludis/util/process.cc +++ b/paludis/util/process.cc @@ -567,7 +567,7 @@ Process::run() if (! _imp->capture_stdout) { thread->own_capture_stdout.reset(new SafeOFStream(STDOUT_FILENO, false)); - _imp->capture_stdout = thread->own_capture_stdout.get(); + _imp->capture_stdout = *thread->own_capture_stdout; } } @@ -577,7 +577,7 @@ Process::run() if (! _imp->capture_stderr) { thread->own_capture_stderr.reset(new SafeOFStream(STDERR_FILENO, false)); - _imp->capture_stderr = thread->own_capture_stderr.get(); + _imp->capture_stderr = *thread->own_capture_stderr; } } diff --git a/paludis/util/safe_ofstream.cc b/paludis/util/safe_ofstream.cc index 5c3917bb6..859428ecc 100644 --- a/paludis/util/safe_ofstream.cc +++ b/paludis/util/safe_ofstream.cc @@ -109,7 +109,7 @@ SafeOFStreamBase::SafeOFStreamBase(const int f, const bool b) : SafeOFStream::SafeOFStream(const int f, const bool buffer) : SafeOFStreamBase(f, buffer), - std::ostream(&buf), + StreamHolder<std::ostream>(&buf), _close(false) { } @@ -133,7 +133,7 @@ namespace SafeOFStream::SafeOFStream(const FSPath & p, const int open_flags, const bool b) : SafeOFStreamBase(check_open_path(p, open_flags), b), - std::ostream(&buf), + StreamHolder<std::ostream>(&buf), _close(true) { } diff --git a/paludis/util/safe_ofstream.hh b/paludis/util/safe_ofstream.hh index 8392c1d82..e77120b1d 100644 --- a/paludis/util/safe_ofstream.hh +++ b/paludis/util/safe_ofstream.hh @@ -24,6 +24,7 @@ #include <paludis/util/exception.hh> #include <paludis/util/fs_path-fwd.hh> #include <paludis/util/pimp.hh> +#include <paludis/util/stream_holder.hh> #include <ostream> /** \file @@ -106,7 +107,7 @@ namespace paludis */ class PALUDIS_VISIBLE SafeOFStream : protected SafeOFStreamBase, - public std::ostream + public StreamHolder<std::ostream> { private: const bool _close; |