mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00:00
shared: install - report error if mask symlink can not be marked for removal
(cherry picked from commit 56e73b34ce)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
48da391c5e
commit
9c521fc99e
+5
-10
@@ -662,7 +662,7 @@ int unit_file_unmask(
|
||||
goto finish;
|
||||
|
||||
STRV_FOREACH(i, files) {
|
||||
char *path;
|
||||
_cleanup_free_ char *path = NULL;
|
||||
|
||||
if (!unit_name_is_valid(*i, TEMPLATE_VALID)) {
|
||||
if (r == 0)
|
||||
@@ -678,21 +678,16 @@ int unit_file_unmask(
|
||||
|
||||
q = null_or_empty_path(path);
|
||||
if (q > 0) {
|
||||
if (unlink(path) >= 0) {
|
||||
mark_symlink_for_removal(&remove_symlinks_to, path);
|
||||
if (unlink(path) < 0)
|
||||
q = -errno;
|
||||
else {
|
||||
q = mark_symlink_for_removal(&remove_symlinks_to, path);
|
||||
add_file_change(changes, n_changes, UNIT_FILE_UNLINK, path, NULL);
|
||||
|
||||
free(path);
|
||||
continue;
|
||||
}
|
||||
|
||||
q = -errno;
|
||||
}
|
||||
|
||||
if (q != -ENOENT && r == 0)
|
||||
r = q;
|
||||
|
||||
free(path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user