diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-06-03 13:55:13 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-06-03 13:55:17 -0400 |
commit | 02b9e969a6f512d2312e7028ce5c48c84ad87d06 (patch) | |
tree | a35a07c17852a7edb5c731b716e5ef3123964905 /src/shared/install.c | |
parent | 5b46fc6c609cab439eb447c7528d5d7096aa3d2f (diff) |
systemctl,core: allow nuking of symlinks to removed units
Before, one the unit file was deleted, install_context_for_removal()
would refuse to look for symlinks. But we can remove dangling symlinks
anyway.
In principle, package installation/deinstallation scripts should do
that before the unit is uninstalled, but they don't always do. Also,
a user might have added additional symlinks manually.
https://bugs.freedesktop.org/show_bug.cgi?id=62395
Diffstat (limited to 'src/shared/install.c')
-rw-r--r-- | src/shared/install.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/install.c b/src/shared/install.c index 954dcb1e71..d2dd276803 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1413,7 +1413,9 @@ static int install_context_mark_for_removal( assert_se(hashmap_move_one(c->have_installed, c->will_install, i->name) == 0); q = unit_file_search(c, i, paths, root_dir, false); - if (q < 0) { + if (q == -ENOENT) { + /* do nothing */ + } else if (q < 0) { if (r >= 0) r = q; |