From: Zbigniew Jędrzejewski-Szmek Date: Sat, 23 Mar 2024 12:30:24 +0000 (+0100) Subject: shared/install: use PATH_IN_SET() X-Git-Tag: v256-rc1~430^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acb27fba43e463bca3fe83f4100e1f3789116233;p=thirdparty%2Fsystemd.git shared/install: use PATH_IN_SET() --- diff --git a/src/shared/install.c b/src/shared/install.c index cd27baf3919..15cab9a6127 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -162,9 +162,10 @@ static int path_is_generator(const LookupPaths *lp, const char *path) { if (r < 0) return r; - return path_equal(parent, lp->generator) || - path_equal(parent, lp->generator_early) || - path_equal(parent, lp->generator_late); + return PATH_IN_SET(parent, + lp->generator, + lp->generator_early, + lp->generator_late); } static int path_is_transient(const LookupPaths *lp, const char *path) { @@ -192,8 +193,9 @@ static int path_is_control(const LookupPaths *lp, const char *path) { if (r < 0) return r; - return path_equal(parent, lp->persistent_control) || - path_equal(parent, lp->runtime_control); + return PATH_IN_SET(parent, + lp->persistent_control, + lp->runtime_control); } static int path_is_config(const LookupPaths *lp, const char *path, bool check_parent) { @@ -214,8 +216,9 @@ static int path_is_config(const LookupPaths *lp, const char *path, bool check_pa path = parent; } - return path_equal(path, lp->persistent_config) || - path_equal(path, lp->runtime_config); + return PATH_IN_SET(path, + lp->persistent_config, + lp->runtime_config); } static int path_is_runtime(const LookupPaths *lp, const char *path, bool check_parent) { @@ -241,12 +244,13 @@ static int path_is_runtime(const LookupPaths *lp, const char *path, bool check_p path = parent; } - return path_equal(path, lp->runtime_config) || - path_equal(path, lp->generator) || - path_equal(path, lp->generator_early) || - path_equal(path, lp->generator_late) || - path_equal(path, lp->transient) || - path_equal(path, lp->runtime_control); + return PATH_IN_SET(path, + lp->runtime_config, + lp->generator, + lp->generator_early, + lp->generator_late, + lp->transient, + lp->runtime_control); } static int path_is_vendor_or_generator(const LookupPaths *lp, const char *path) {