mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
shared/install: use PATH_IN_SET()
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user