Rename ActionExitCode to ErrorCode

Nowadays ActionExitCode is used throughout the codebase so use a more
generic name to reflect this.

BUG=chromium:216507
TEST=unit tests pass

Change-Id: I23d1d7e2676443251dbc42ed137fd018aadfa8a3
Reviewed-on: https://gerrit.chromium.org/gerrit/49512
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/filesystem_copier_action.cc b/filesystem_copier_action.cc
index 1561f93..7024b67 100644
--- a/filesystem_copier_action.cc
+++ b/filesystem_copier_action.cc
@@ -73,7 +73,7 @@
     // No copy or hash verification needed. Done!
     if (HasOutputPipe())
       SetOutputObject(install_plan_);
-    abort_action_completer.set_code(kActionCodeSuccess);
+    abort_action_completer.set_code(kErrorCodeSuccess);
     return;
   }
 
@@ -132,7 +132,7 @@
   return (src_stream_ != NULL);
 }
 
-void FilesystemCopierAction::Cleanup(ActionExitCode code) {
+void FilesystemCopierAction::Cleanup(ErrorCode code) {
   for (int i = 0; i < 2; i++) {
     g_object_unref(canceller_[i]);
     canceller_[i] = NULL;
@@ -145,7 +145,7 @@
   }
   if (cancelled_)
     return;
-  if (code == kActionCodeSuccess && HasOutputPipe())
+  if (code == kErrorCodeSuccess && HasOutputPipe())
     SetOutputObject(install_plan_);
   processor_->ActionComplete(this, code);
 }
@@ -244,7 +244,7 @@
   }
   if (failed_ || cancelled_) {
     if (!reading && !writing) {
-      Cleanup(kActionCodeError);
+      Cleanup(kErrorCodeError);
     }
     return;
   }
@@ -278,18 +278,18 @@
   }
   if (!reading && !writing) {
     // We're done!
-    ActionExitCode code = kActionCodeSuccess;
+    ErrorCode code = kErrorCodeSuccess;
     if (hasher_.Finalize()) {
       LOG(INFO) << "Hash: " << hasher_.hash();
       if (verify_hash_) {
         if (copying_kernel_install_path_) {
           if (install_plan_.kernel_hash != hasher_.raw_hash()) {
-            code = kActionCodeNewKernelVerificationError;
+            code = kErrorCodeNewKernelVerificationError;
             LOG(ERROR) << "New kernel verification failed.";
           }
         } else {
           if (install_plan_.rootfs_hash != hasher_.raw_hash()) {
-            code = kActionCodeNewRootfsVerificationError;
+            code = kErrorCodeNewRootfsVerificationError;
             LOG(ERROR) << "New rootfs verification failed.";
           }
         }
@@ -302,7 +302,7 @@
       }
     } else {
       LOG(ERROR) << "Unable to finalize the hash.";
-      code = kActionCodeError;
+      code = kErrorCodeError;
     }
     Cleanup(code);
   }