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:
parent
a454d241ef
commit
e8372f7e3e
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user