summaryrefslogtreecommitdiff
path: root/src/shared/path-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-06 22:49:19 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-06 23:16:16 -0500
commit874310b7b68c4c0d36ff07397db30a959bb7dae5 (patch)
tree751b1bb5db5c3ad7c60b199476b47e44e326bf46 /src/shared/path-util.c
parent56ba3c78ae35065064c4289a0c8e22a81256af20 (diff)
systemd: do not remove empty paths from unit lookup path
The ability to start a new unit with 'systemctl start ...' should not depend on whether there are other units in the directory. Previously, an additional 'systemctl daemon-reload' would be necessary to tell systemd to update the list of unit lookup paths.
Diffstat (limited to 'src/shared/path-util.c')
-rw-r--r--src/shared/path-util.c14
1 files changed, 9 insertions, 5 deletions
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;