anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0481-core-properly-handle-jobs-that-are-suppressed-to-JOB.patch

803fb7
From b5ed9900d9a02abd78bfb151932748725b7c0bdb Mon Sep 17 00:00:00 2001
803fb7
From: Lennart Poettering <lennart@poettering.net>
803fb7
Date: Thu, 21 May 2015 20:39:23 +0200
803fb7
Subject: [PATCH] core: properly handle jobs that are suppressed to JOB_NOPs
803fb7
 when propagating restarts
803fb7
803fb7
Cherry-picked from: 48894cd0
803fb7
Resolves: #1436021
803fb7
---
803fb7
 src/core/transaction.c | 7 ++++++-
803fb7
 1 file changed, 6 insertions(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/core/transaction.c b/src/core/transaction.c
803fb7
index 34df15718..66bbb6066 100644
803fb7
--- a/src/core/transaction.c
803fb7
+++ b/src/core/transaction.c
803fb7
@@ -1023,8 +1023,13 @@ int transaction_add_job_and_dependencies(
803fb7
 
803fb7
                         for (j = 0; j < ELEMENTSOF(propagate_deps); j++)
803fb7
                                 SET_FOREACH(dep, ret->unit->dependencies[propagate_deps[j]], i) {
803fb7
+                                        JobType nt;
803fb7
 
803fb7
-                                        r = transaction_add_job_and_dependencies(tr, job_type_collapse(ptype, dep), dep, ret, true, override, false, false, ignore_order, e);
803fb7
+                                        nt = job_type_collapse(ptype, dep);
803fb7
+                                        if (nt == JOB_NOP)
803fb7
+                                                continue;
803fb7
+
803fb7
+                                        r = transaction_add_job_and_dependencies(tr, nt, dep, ret, true, override, false, false, ignore_order, e);
803fb7
                                         if (r < 0) {
803fb7
                                                 if (r != -EBADR)
803fb7
                                                         goto fail;