chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-bus: get rid of PID starttime concept
[elogind.git]
/
src
/
shared
/
install.c
diff --git
a/src/shared/install.c
b/src/shared/install.c
index 8a7f7e209437c5c886bbe628324d05b7761e7142..5bb33859832e4518a07027a12cd4d06915c07ed9 100644
(file)
--- a/
src/shared/install.c
+++ b/
src/shared/install.c
@@
-662,7
+662,7
@@
int unit_file_unmask(
goto finish;
STRV_FOREACH(i, files) {
goto finish;
STRV_FOREACH(i, files) {
-
char *path
;
+
_cleanup_free_ char *path = NULL
;
if (!unit_name_is_valid(*i, TEMPLATE_VALID)) {
if (r == 0)
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) {
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);
add_file_change(changes, n_changes, UNIT_FILE_UNLINK, path, NULL);
-
- free(path);
- continue;
}
}
-
- q = -errno;
}
if (q != -ENOENT && r == 0)
r = q;
}
if (q != -ENOENT && r == 0)
r = q;
-
- free(path);
}
}
@@
-1553,10
+1548,8
@@
int unit_file_add_dependency(
UnitFileState state;
state = unit_file_get_state(scope, root_dir, *i);
UnitFileState state;
state = unit_file_get_state(scope, root_dir, *i);
- if (state < 0) {
- log_error("Failed to get unit file state for %s: %s", *i, strerror(-state));
- return state;
- }
+ if (state < 0)
+ return log_error_errno(state, "Failed to get unit file state for %s: %m", *i);
if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
log_error("Failed to enable unit: Unit %s is masked", *i);
if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
log_error("Failed to enable unit: Unit %s is masked", *i);