From 874310b7b68c4c0d36ff07397db30a959bb7dae5 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 6 Feb 2013 22:49:19 -0500 Subject: 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. --- src/shared/path-util.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/shared/path-util.c') 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; -- cgit v1.2.3-54-g00ecf