diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/path-lookup.c | 3 | ||||
-rw-r--r-- | src/shared/path-util.c | 14 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c index 6e5529e0c7..8ee9ddc9c6 100644 --- a/src/shared/path-lookup.c +++ b/src/shared/path-lookup.c @@ -316,7 +316,6 @@ int lookup_paths_init( return -ENOMEM; strv_uniq(p->unit_path); - path_strv_remove_empty(p->unit_path); if (!strv_isempty(p->unit_path)) { @@ -379,8 +378,6 @@ int lookup_paths_init( strv_uniq(p->sysvinit_path); strv_uniq(p->sysvrcnd_path); - path_strv_remove_empty(p->sysvinit_path); - path_strv_remove_empty(p->sysvrcnd_path); if (!strv_isempty(p->sysvinit_path)) { diff --git a/src/shared/path-util.c b/src/shared/path-util.c index dd12d3d634..4857971b33 100644 --- a/src/shared/path-util.c +++ b/src/shared/path-util.c @@ -190,13 +190,17 @@ char **path_strv_canonicalize(char **l) { errno = 0; u = canonicalize_file_name(t); - free(t); if (!u) { - if (errno == ENOMEM || !errno) - enomem = true; - - continue; + if (errno == ENOENT) + u = t; + else { + free(t); + if (errno == ENOMEM || !errno) + enomem = true; + + continue; + } } l[k++] = u; |