core/unit: always propagate reload_result as job result, even if state is unexpected

The end state of unit shouldn't have any impact on reload job, as
either way the reload operation has been aborted.
This commit is contained in:
Mike Yuan
2025-11-15 21:08:50 +01:00
parent a5b1a79461
commit 2334953a49

View File

@@ -2649,9 +2649,7 @@ static bool unit_process_job(Job *j, UnitActiveState ns, bool reload_success) {
job_finish_and_invalidate(j, reload_success ? JOB_DONE : JOB_FAILED, true, false);
else if (!IN_SET(ns, UNIT_ACTIVATING, UNIT_RELOADING, UNIT_REFRESHING)) {
unexpected = true;
if (UNIT_IS_INACTIVE_OR_FAILED(ns))
job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_CANCELED, true, false);
job_finish_and_invalidate(j, reload_success ? JOB_CANCELED : JOB_FAILED, true, false);
}
}