Skip to content

Commit

Permalink
shared/install: propagate all errors in install_info_apply()
Browse files Browse the repository at this point in the history
Currently, install_info_apply() only updates r if it's 0,
meaning that if one of the earlier install_info_symlink_alias/wants()
calls returns > 0, errors generated by later calls will be discarded.
Fix that.

(cherry picked from commit a159aa07e1548367d2fde80cb0d45b869c591864)
(cherry picked from commit bb83650f96af1a7f803696fab5dd06442c789b1c)
  • Loading branch information
YHNdnzj authored and bluca committed Jul 24, 2024
1 parent f6ef5e6 commit 40b9bde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shared/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -2105,15 +2105,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;
Expand Down

0 comments on commit 40b9bde

Please sign in to comment.