systemd/0967-manager-reformat-boolean-expression-in-unit_is_prist.patch
Jan Macku ef967387bc systemd-239-78
Resolves: #2156620,#2158167,#2179309,#2211358,#2211416,#2215925,#2223582,#2231846
2023-08-22 16:01:05 +02:00

42 lines
1.5 KiB
Diff

From af4b13c93d55fcbb535c94b0ab2c0aa54a6601d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 14 Oct 2022 14:40:24 +0200
Subject: [PATCH] manager: reformat boolean expression in unit_is_pristine()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Not not IN_SET(…) is just too much for my poor brain. Let's invert
the expression to make it easier to undertand.
(cherry picked from commit b146a7345b69de16e88347acadb3783ffeeaad9d)
Related: #2156620
---
src/core/unit.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 9be2a0c326..78666e73bf 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -4848,12 +4848,12 @@ bool unit_is_pristine(Unit *u) {
* are marked UNIT_LOADED even though nothing was actually
* loaded, as those unit types don't require a file on disk. */
- return !(!IN_SET(u->load_state, UNIT_NOT_FOUND, UNIT_LOADED) ||
- u->fragment_path ||
- u->source_path ||
- !strv_isempty(u->dropin_paths) ||
- u->job ||
- u->merged_into);
+ return IN_SET(u->load_state, UNIT_NOT_FOUND, UNIT_LOADED) &&
+ !u->fragment_path &&
+ !u->source_path &&
+ strv_isempty(u->dropin_paths) &&
+ !u->job &&
+ !u->merged_into;
}
pid_t unit_control_pid(Unit *u) {