-
-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exit(130) is not the same as raise(SIGINT) #854
Comments
Thank you for reporting this. I guess this should be easy to fix using sth. like
|
Yeah that's what I was thinking. Didn't get around to it yet because I'm not sure what the right behavior is on Windows. But I could at least fix it on *nix first |
using |
fd handles ^C by propagating
ExitCode::KilledBySigint
up tomain()
which doesprocess::exit(exit_code.into())
. But exit code 130 is a lie told by bash (this comment has a good explanation: rust-lang/rust#62569 (comment)).This is observable from programs that check
WIFEXITED()
/WIFSIGNALED()
. Here's a crude example:The right way to pretend to die by SIGINT is something like
signal(SIGINT, SIG_DFL); raise(SIGINT);
.The text was updated successfully, but these errors were encountered: