mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 15:21:37 +03:00
install: use path_strv_contains() where appropriate
This commit is contained in:
parent
3593fa60f2
commit
9a2ec8f7a6
@ -105,7 +105,6 @@ DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(unit_file_type, UnitFileType);
|
|||||||
|
|
||||||
static int in_search_path(const LookupPaths *p, const char *path) {
|
static int in_search_path(const LookupPaths *p, const char *path) {
|
||||||
_cleanup_free_ char *parent = NULL;
|
_cleanup_free_ char *parent = NULL;
|
||||||
char **i;
|
|
||||||
|
|
||||||
assert(path);
|
assert(path);
|
||||||
|
|
||||||
@ -113,11 +112,7 @@ static int in_search_path(const LookupPaths *p, const char *path) {
|
|||||||
if (!parent)
|
if (!parent)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
STRV_FOREACH(i, p->search_path)
|
return path_strv_contains(p->search_path, parent);
|
||||||
if (path_equal(parent, *i))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* skip_root(const LookupPaths *p, const char *path) {
|
static const char* skip_root(const LookupPaths *p, const char *path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user