summaryrefslogtreecommitdiff
path: root/src/shared/install.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-11-29 11:14:48 +0100
committerTom Gundersen <teg@jklm.no>2014-11-29 11:14:48 +0100
commit56e73b34ce0b020ef54c0dc2aba16e50d4fea9f5 (patch)
treec489424eaa57b14cc57c222cffd0ffed8c2fa842 /src/shared/install.c
parent681f9718ce322da95578e20ed975dfb34e7edd23 (diff)
shared: install - report error if mask symlink can not be marked for removal
Diffstat (limited to 'src/shared/install.c')
-rw-r--r--src/shared/install.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index af35b29df3..5bb3385983 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -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);
}