Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1276)

Unified Diff: download_action.cc

Issue 3022008: For actions, switch bool success into an exit code. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: switch to all positive error codes. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « action_unittest.cc ('k') | download_action_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_action.cc
diff --git a/download_action.cc b/download_action.cc
index 4787ee2ace87889c757aaaeddef0e0a931c8049e..9be81f0eb763a69c694d7ca0210729b2ea7d52b8 100644
--- a/download_action.cc
+++ b/download_action.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -61,7 +61,7 @@ void DownloadAction::PerformAction() {
if (rc < 0) {
LOG(ERROR) << "Unable to open output file " << install_plan_.install_path;
// report error to processor
- processor_->ActionComplete(this, false);
+ processor_->ActionComplete(this, kActionCodeError);
return;
}
if (!install_plan_.is_full_update) {
@@ -70,7 +70,7 @@ void DownloadAction::PerformAction() {
LOG(ERROR) << "Unable to open kernel file "
<< install_plan_.kernel_install_path.c_str();
writer_->Close();
- processor_->ActionComplete(this, false);
+ processor_->ActionComplete(this, kActionCodeError);
return;
}
}
@@ -126,13 +126,15 @@ void DownloadAction::TransferComplete(HttpFetcher *fetcher, bool successful) {
successful = false;
}
}
-
+
FlushLinuxCaches();
// Write the path to the output pipe if we're successful
if (successful && HasOutputPipe())
SetOutputObject(GetInputObject());
- processor_->ActionComplete(this, successful);
+ processor_->ActionComplete(
+ this,
+ successful ? kActionCodeSuccess : kActionCodeError);
}
}; // namespace {}
« no previous file with comments | « action_unittest.cc ('k') | download_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698