summaryrefslogtreecommitdiffstats
path: root/src/shared/install.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/install.c')
-rw-r--r--src/shared/install.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index c94b456..53566b7 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1989,7 +1989,9 @@ static int install_info_symlink_alias(
}
broken = r == 0; /* symlink target does not exist? */
- RET_GATHER(ret, create_symlink(lp, alias_target ?: info->path, alias_path, force || broken, changes, n_changes));
+ r = create_symlink(lp, alias_target ?: info->path, alias_path, force || broken, changes, n_changes);
+ if (r != 0 && ret >= 0)
+ ret = r;
}
return ret;
@@ -2012,7 +2014,7 @@ static int install_info_symlink_wants(
UnitNameFlags valid_dst_type = UNIT_NAME_ANY;
const char *n;
- int r = 0, q;
+ int r, q;
assert(info);
assert(lp);
@@ -2083,7 +2085,7 @@ static int install_info_symlink_wants(
return -ENOMEM;
q = create_symlink(lp, info->path, path, /* force = */ true, changes, n_changes);
- if ((q < 0 && r >= 0) || r == 0)
+ if (q != 0 && r >= 0)
r = q;
if (unit_file_exists(scope, lp, dst) == 0) {
@@ -2155,15 +2157,15 @@ static int install_info_apply(
r = install_info_symlink_alias(scope, info, lp, config_path, force, changes, n_changes);
q = install_info_symlink_wants(scope, file_flags, info, lp, config_path, info->wanted_by, ".wants/", changes, n_changes);
- if (r == 0)
+ if (q != 0 && r >= 0)
r = q;
q = install_info_symlink_wants(scope, file_flags, info, lp, config_path, info->required_by, ".requires/", changes, n_changes);
- if (r == 0)
+ if (q != 0 && r >= 0)
r = q;
q = install_info_symlink_wants(scope, file_flags, info, lp, config_path, info->upheld_by, ".upholds/", changes, n_changes);
- if (r == 0)
+ if (q != 0 && r >= 0)
r = q;
return r;