Repository navigation
Return a traditional exit code when core dumped - #12370
Closed
sholderbach wants to merge 2 commits into
Closed
sholderbach wants to merge 2 commits into
sholderbach wants to merge 2 commits into
Conversation
running a program `fail` dumping its core with `fail | complete | get exit_code` should return a `Value::Int` corresponding to its exit code. Previously we sent a full `Value::Error(ShellError)` which was incompatible with all other exit code logic. Now get just the exit code but still print to STDERR.
IanManske
reviewed
Apr 2, 2024
| span: head, | ||
| }, | ||
| let _ = exit_code_tx.send(Value::int( | ||
| // If we don't get a code (unlikely) |
Member
There was a problem hiding this comment.
This is highly likely. On unix, if a process is killed via signal, then code() will be None.
It's probably out of scope for this PR, but in the future this should match what we do for signals when the process doesn't core dump (right now, we always return -1 which is odd).
Contributor
|
I think it's already handled by #12774, maybe we can close this |
Member
Author
|
Yup, thanks for the reminder. |
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.
Description
Attempt to fix #12369
running a program
faildumping its core withfail | complete | get exit_codeshould return aValue::Intcorresponding to its exit code.User-Facing Changes
Previously we sent a full
Value::Error(ShellError)which wasincompatible with all other exit code logic.
Now get just the exit code but still print to STDERR.