summaryrefslogtreecommitdiffstats
path: root/src/shared/install.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:20:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:20:44 +0000
commitca5ecaae7a8f75e18ba85b29839752da76e3b7b9 (patch)
tree6f62ddc7fbe8ae132441a0b25e2a76e423e66e9f /src/shared/install.c
parentReleasing progress-linux version 256.2-1~progress7.99u1. (diff)
downloadsystemd-ca5ecaae7a8f75e18ba85b29839752da76e3b7b9.tar.xz
systemd-ca5ecaae7a8f75e18ba85b29839752da76e3b7b9.zip
Merging upstream version 256.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;