From 06d7b4aebd9e4a1a87f77fe59a8c08392318be5d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 May 2020 01:36:11 +0100 Subject: refactor(3p/nix/libutil): Replace chomp() with absl::strings --- third_party/nix/src/build-remote/build-remote.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/build-remote') diff --git a/third_party/nix/src/build-remote/build-remote.cc b/third_party/nix/src/build-remote/build-remote.cc index 04fcf389705d..9403d3c35e99 100644 --- a/third_party/nix/src/build-remote/build-remote.cc +++ b/third_party/nix/src/build-remote/build-remote.cc @@ -6,6 +6,8 @@ #include #include +#include +#include #include #include "derivations.hh" @@ -199,9 +201,10 @@ static int _main(int argc, char* argv[]) { storeUri = bestMachine->storeUri; } catch (std::exception& e) { - auto msg = chomp(drainFD(5, false)); + auto msg = absl::StripTrailingAsciiWhitespace(drainFD(5, false)); LOG(ERROR) << "cannot build on '" << bestMachine->storeUri - << "': " << e.what() << (msg.empty() ? "" : ": " + msg); + << "': " << e.what() + << (msg.empty() ? "" : absl::StrCat(": ", msg)); bestMachine->enabled = false; continue; } -- cgit 1.4.1