summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-19 21:02:16 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-20 19:37:02 +0100
commite8372f7e3e3a5aba053b1b5b944cb84d6d525877 (patch)
treece6db655490d2bc77de5506c60059c34ba0d1599 /src
parenta454d241ef8b08e0984c6efbbd6187d70e32145b (diff)
install: when determining where default.target points to, accept a file instead of a symlink, too
Diffstat (limited to 'src')
-rw-r--r--src/shared/install.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index 881f715a07..2c119e2dca 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1638,10 +1638,14 @@ int unit_file_get_default(
r = readlink_malloc(path, &tmp);
if (r == -ENOENT)
continue;
- if (r < 0)
+ else if (r == -EINVAL)
+ /* not a symlink */
+ n = strdup(SPECIAL_DEFAULT_TARGET);
+ else if (r < 0)
return r;
+ else
+ n = strdup(path_get_file_name(tmp));
- n = strdup(path_get_file_name(tmp));
if (!n)
return -ENOMEM;