1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

install: when determining where default.target points to, accept a file instead of a symlink, too

This commit is contained in:
Lennart Poettering 2013-11-19 21:02:16 +01:00
parent a454d241ef
commit e8372f7e3e

View File

@ -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));
if (!n)
return -ENOMEM;