Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Updates the coreutils multicall binary to return std::process::ExitCode from main instead of calling process::exit in most paths, aligning with Rust idioms and improving destructor/drop behavior.
Changes:
- Change
mainsignature tofn main() -> ExitCodeand replace manyexit(0/1)calls withreturn ExitCode::{SUCCESS,FAILURE}. - Preserve behavior for non-
u8exit codes by falling back toprocess::exit(code)when needed.
| File | Description |
|---|---|
| src/bin/coreutils.rs | Switches main to return ExitCode and replaces most direct exit() calls with returned exit codes. |
Review effort: Lite
Comment on lines
+58
to
+61
| let Some(binary_as_util) = validation::name(&binary) else { | ||
| usage(&utils, "<unknown binary name>"); | ||
| exit(0); | ||
| }); | ||
| return ExitCode::SUCCESS; | ||
| }; |
Comment on lines
+124
to
+127
| let code = uumain(vec![util_os].into_iter().chain(args)); | ||
| // Return instead of exiting so that locals are dropped; exit codes | ||
| // that don't fit in a u8 (Windows) still need process::exit. | ||
| return u8::try_from(code).map_or_else(|_| exit(code), ExitCode::from); |
Copilot stopped reviewing on behalf of
sylvestre due to an error
October 19, 2026 20:59
cakebaker
reviewed
Oct 20, 2026
| @@ -120,12 +121,15 @@ fn main() { | |||
| // Could be something like: | |||
| // #[cfg(not(feature = "only_english"))] | |||
| validation::setup_localization_or_exit(util); | |||
Contributor
There was a problem hiding this comment.
Is it intentional that this exit is left untouched?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

closes: #15522