diff options
author | David Kalnischkies <david@kalnischkies.de> | 2017-01-19 04:14:08 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2017-02-22 18:11:44 +0100 |
commit | 9735e1d76cf1ab3973460a682eea3a1948c1c1d9 (patch) | |
tree | ee76611a1aad94531808ffb63d54bf29d17ed087 | |
parent | 7012a9b530109b68d7b27ff4b43968e8ac6d109d (diff) |
stop rred from leaking debug messages on recovered errors
rred can fail for a plentory of reasons, but its failure is usually
recoverable (Ign lines) so it shouldn't leak unrequested debug messages
to an observing user.
Closes: #850759
(cherry picked from commit 2984d7aec37e09b473c7b99f43d20622c25dc99d)
(cherry picked from commit d0a345d4a41802e9129b78d70aabd6239a3c651a)
-rw-r--r-- | methods/rred.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/methods/rred.cc b/methods/rred.cc index e2124fd05..7f49322f0 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -663,12 +663,14 @@ class RredMethod : public aptMethod { FileFd inp, out; if (inp.Open(Path, FileFd::ReadOnly, FileFd::Extension) == false) { - std::cerr << "FAILED to open inp " << Path << std::endl; + if (Debug == true) + std::clog << "FAILED to open inp " << Path << std::endl; return _error->Error("Failed to open inp %s", Path.c_str()); } if (out.Open(Itm->DestFile, FileFd::WriteOnly | FileFd::Create | FileFd::Empty | FileFd::BufferedWrite, FileFd::Extension) == false) { - std::cerr << "FAILED to open out " << Itm->DestFile << std::endl; + if (Debug == true) + std::clog << "FAILED to open out " << Itm->DestFile << std::endl; return _error->Error("Failed to open out %s", Itm->DestFile.c_str()); } @@ -687,7 +689,8 @@ class RredMethod : public aptMethod { inp.Close(); if (_error->PendingError() == true) { - std::cerr << "FAILED to read or write files" << std::endl; + if (Debug == true) + std::clog << "FAILED to read or write files" << std::endl; return false; } |