diff options
Diffstat (limited to 'third_party/nix/src/libstore/store-api.cc')
-rw-r--r-- | third_party/nix/src/libstore/store-api.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/third_party/nix/src/libstore/store-api.cc b/third_party/nix/src/libstore/store-api.cc index fc33c7ce5711..3ada63532ca2 100644 --- a/third_party/nix/src/libstore/store-api.cc +++ b/third_party/nix/src/libstore/store-api.cc @@ -1,6 +1,8 @@ #include "libstore/store-api.hh" #include <future> +#include <ostream> +#include <streambuf> #include <utility> #include <absl/status/status.h> @@ -23,6 +25,17 @@ namespace nix { +namespace { +class NullStream : public std::streambuf { + public: + int overflow(int c) override { return c; } +}; + +static NullStream NULL_STREAM{}; +} // namespace + +std::ostream DiscardLogsSink() { return std::ostream(&NULL_STREAM); } + std::optional<BuildMode> BuildModeFrom(nix::proto::BuildMode mode) { switch (mode) { case nix::proto::BuildMode::Normal: |