core/unit: mark running reload job as canceled if the unit deactivated

The semantics of reload is that the service updates its extrinsic state
and continues execution. If it actually deactivated we shouldn't
spuriously notify the caller that reload succeeded.
This commit is contained in:
Mike Yuan
2025-11-15 21:06:39 +01:00
parent 7cb0030f6c
commit a5b1a79461

View File

@@ -2651,7 +2651,7 @@ static bool unit_process_job(Job *j, UnitActiveState ns, bool reload_success) {
unexpected = true;
if (UNIT_IS_INACTIVE_OR_FAILED(ns))
job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_DONE, true, false);
job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_CANCELED, true, false);
}
}