From 509ad7897c7f15b7423e69747ce552d1673f499d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 May 2018 11:39:57 +0200 Subject: [PATCH] core/job: shortening Follow-up for a7a7163df7fc8a9f794f6803b2f6c9c9b0745a1f. --- src/core/job.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index a0f7685c4e..92abd60c2f 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -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 */