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

Unified Diff: filesystem_copier_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 | « download_action_unittest.cc ('k') | filesystem_copier_action_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filesystem_copier_action.cc
diff --git a/filesystem_copier_action.cc b/filesystem_copier_action.cc
index 6d7cd22d95ff46632b8950c5942581ce5a9aad4e..388e0e7a88b57fce7cfbc7582b2fde39d125bba6 100755
--- a/filesystem_copier_action.cc
+++ b/filesystem_copier_action.cc
@@ -45,7 +45,7 @@ void FilesystemCopierAction::PerformAction() {
// No copy needed. Done!
if (HasOutputPipe())
SetOutputObject(install_plan_);
- abort_action_completer.set_success(true);
+ abort_action_completer.set_code(kActionCodeSuccess);
return;
}
@@ -59,7 +59,7 @@ void FilesystemCopierAction::PerformAction() {
const string destination = copying_kernel_install_path_ ?
install_plan_.kernel_install_path :
install_plan_.install_path;
-
+
int src_fd = open(source.c_str(), O_RDONLY);
if (src_fd < 0) {
PLOG(ERROR) << "Unable to open " << source << " for reading:";
@@ -110,7 +110,9 @@ void FilesystemCopierAction::Cleanup(bool success, bool was_cancelled) {
return;
if (success && HasOutputPipe())
SetOutputObject(install_plan_);
- processor_->ActionComplete(this, success);
+ processor_->ActionComplete(
+ this,
+ success ? kActionCodeSuccess : kActionCodeError);
}
void FilesystemCopierAction::AsyncReadyCallback(GObject *source_object,
« no previous file with comments | « download_action_unittest.cc ('k') | filesystem_copier_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698