From bc32241e6a0b66a5698c32d573ae53df50e1e159 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 15 Apr 2021 11:18:31 +0200 Subject: [PATCH] core: use UNIT_TRIGGER at more places Just some minor simplification. --- src/core/load-fragment.c | 2 +- src/core/path.c | 2 +- src/core/timer.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 6f6a80ccbf..561142d577 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -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; } diff --git a/src/core/path.c b/src/core/path.c index b954ee1f47..04084bf63e 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -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); diff --git a/src/core/timer.c b/src/core/timer.c index 32abdb74d7..b0caaf3850 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -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);