Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3832d49 authored by Yi-Yo Chiang's avatar Yi-Yo Chiang Committed by Yi-yo Chiang
Browse files

first_stage_mount: Fix log typo "check_at_most_once"

Was "check_most_at_once", should be "check_at_most_once".
Also straighten the if-then-else logic from:
  if (cond) {
    // then
  } else {
    // error...
    return;
  }
to:
  if (!cond) {
    // error...
    return;
  }
  // fallthrough is "then"

Test: Presubmit
Change-Id: I85c1e94c47a727089374d5d05ecd40f4187b66a1
parent 46fa45d8
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -507,17 +507,17 @@ bool FirstStageMount::TrySwitchSystemAsRoot() {
        SaveRamdiskPathToSnapuserd();
    }

    if (MountPartition(system_partition, false /* erase_same_mounts */)) {
        if (dsu_not_on_userdata_ && fs_mgr_verity_is_check_at_most_once(*system_partition)) {
            LOG(ERROR) << "check_most_at_once forbidden on external media";
    if (!MountPartition(system_partition, false /* erase_same_mounts */)) {
        PLOG(ERROR) << "Failed to mount /system";
        return false;
    }
        SwitchRoot("/system");
    } else {
        PLOG(ERROR) << "Failed to mount /system";
    if (dsu_not_on_userdata_ && fs_mgr_verity_is_check_at_most_once(*system_partition)) {
        LOG(ERROR) << "check_at_most_once forbidden on external media";
        return false;
    }

    SwitchRoot("/system");

    return true;
}