summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-01-19 04:14:08 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2017-01-19 04:14:08 +0100
commit2984d7aec37e09b473c7b99f43d20622c25dc99d (patch)
tree2e47d54f07ddad872d4961953697617a302a5439 /methods
parent7ca83492e802967f183babf06ab541b1b51f1703 (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
Diffstat (limited to 'methods')
-rw-r--r--methods/rred.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index 958933a07..2e5008d46 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -662,12 +662,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());
}
@@ -686,7 +688,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;
}