For actions, switch bool success into an exit code.
This way we can signal specific error conditions and then
send appropriate events to Omaha from the UpdateAttempter.
BUG=560
TEST=unit tests, gmerged and looked at logs
Review URL: http://codereview.chromium.org/3022008
diff --git a/filesystem_copier_action.cc b/filesystem_copier_action.cc
index 6d7cd22..388e0e7 100755
--- a/filesystem_copier_action.cc
+++ b/filesystem_copier_action.cc
@@ -45,7 +45,7 @@
// 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 @@
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 @@
return;
if (success && HasOutputPipe())
SetOutputObject(install_plan_);
- processor_->ActionComplete(this, success);
+ processor_->ActionComplete(
+ this,
+ success ? kActionCodeSuccess : kActionCodeError);
}
void FilesystemCopierAction::AsyncReadyCallback(GObject *source_object,