]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/job: shortening
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 19 May 2018 09:39:57 +0000 (11:39 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 20 May 2018 14:25:04 +0000 (23:25 +0900)
Follow-up for a7a7163df7fc8a9f794f6803b2f6c9c9b0745a1f.

src/core/job.c

index a0f7685c4e10df55700bdce2897f333e91929bae..92abd60c2f1bc02b6dec0d5aa723ddf435366876 100644 (file)
@@ -915,11 +915,10 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr
                 j->manager->n_failed_jobs++;
 
         job_uninstall(j);
-        /* Remember jobs started before the reload */
-        if (MANAGER_IS_RELOADING(j->manager) && j->reloaded) {
-                if (job_save_pending_finished_job(j) < 0)
-                        job_free(j);
-        } else
+        /* Keep jobs started before the reload to send singal later, free all others */
+        if (!MANAGER_IS_RELOADING(j->manager) ||
+            !j->reloaded ||
+            job_save_pending_finished_job(j) < 0)
                 job_free(j);
 
         /* Fail depending jobs on failure */