From 2334953a498e919d5301222bd3f74dbfcb2b8cf8 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 15 Nov 2025 21:08:50 +0100 Subject: [PATCH] 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. --- src/core/unit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/unit.c b/src/core/unit.c index 7675082e22..8a406a9334 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -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); } }