]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: use UNIT_TRIGGER at more places
authorLennart Poettering <lennart@poettering.net>
Thu, 15 Apr 2021 09:18:31 +0000 (11:18 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 15 Apr 2021 19:38:20 +0000 (20:38 +0100)
Just some minor simplification.

src/core/load-fragment.c
src/core/path.c
src/core/timer.c

index 6f6a80ccbf2dbb6102da0620402662aedf438184..561142d5779a344e44408561f32f8a27cc071e64 100644 (file)
@@ -2015,7 +2015,7 @@ int config_parse_trigger_unit(
         assert(rvalue);
         assert(data);
 
-        if (!hashmap_isempty(u->dependencies[UNIT_TRIGGERS])) {
+        if (UNIT_TRIGGER(u)) {
                 log_syntax(unit, LOG_WARNING, filename, line, 0, "Multiple units to trigger specified, ignoring: %s", rvalue);
                 return 0;
         }
index b954ee1f47d30f33d84e05db5e08f792f1380bda..04084bf63e412727c37475f136e4ad23a6246902 100644 (file)
@@ -316,7 +316,7 @@ static int path_add_trigger_dependencies(Path *p) {
 
         assert(p);
 
-        if (!hashmap_isempty(UNIT(p)->dependencies[UNIT_TRIGGERS]))
+        if (UNIT_TRIGGER(UNIT(p)))
                 return 0;
 
         r = unit_load_related_unit(UNIT(p), ".service", &x);
index 32abdb74d76c52abdff304864da205cd31864dde..b0caaf385041a9cbc680200fdb0fdd57badae518 100644 (file)
@@ -124,7 +124,7 @@ static int timer_add_trigger_dependencies(Timer *t) {
 
         assert(t);
 
-        if (!hashmap_isempty(UNIT(t)->dependencies[UNIT_TRIGGERS]))
+        if (UNIT_TRIGGER(UNIT(t)))
                 return 0;
 
         r = unit_load_related_unit(UNIT(t), ".service", &x);