1
0
mirror of https://github.com/systemd/systemd synced 2024-07-01 07:34:28 +00:00

shared/install: correctly report changes in install_info_symlink_alias()

Follow-up for b2751cf039

Also make the conditions consistent for install_info_symlink_wants().

Fixes #33411
This commit is contained in:
Mike Yuan 2024-06-19 18:45:14 +02:00
parent a159aa07e1
commit 4441cf330b
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -1986,7 +1986,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;
@ -2080,7 +2082,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) {