-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
lib.rs: restore default SIGPIPE signal handler #9620
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
Conversation
|
GNU testsuite comparison: |
b6cadd5 to
88108bf
Compare
|
GNU testsuite comparison: |
Rust's start-up code sets the SIGPIPE signal handler to ignored. However the vast majority of the utilities should use the default signal handler for SIGPIPE. Instead of restoring the default signaler handler in individual utilities, do it in lib.rs and add some logic in the utilities which can't use the default SIGPIPE signal handler (cat, env, seq, split, tail, tee, tr, tty). Signed-off-by: Etienne Cordonnier <[email protected]>
88108bf to
a9cade6
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
There's a PR here that does some advanced stuff to get both Default SIGPIPE and SIGPIPE ignored to match GNU behavior but it does it in a totally different way. |
|
@ChrisDryden are you talking about my PR #9620 or about some other PR? Did you really mean "both default SIGPIPE and SIGPIPE"? I don't understand what that means. Do you mean "both default signal SIGPIPE handler and custom SIGPIPE handler"? |
|
Whoops meant to add the link to this pr with that comment #9184 I don't think this implementation covers: Default SIGPIPE and SIGPIPE ignored |
Thanks for the link. This is very interesting. I hope it can work that way. |
|
I think this PR can be resolved now that we have the signals.rs shared library thats able to restore the default SIGPIPE handler? |
|
Superseded by #9657 |
Rust's start-up code sets the SIGPIPE signal handler to ignored. However the vast majority of the utilities should use the default signal handler for SIGPIPE rather than ignore SIGPIPE. (in reality those utilities should inherit the signal handler from their parent process, but this is not possible with current rust start-up code).
Instead of restoring the default signaler handler in individual utilities, do it in lib.rs and add some logic in the utilities which can't use the default SIGPIPE signal handler (cat, env, seq, split, tail, tee, tr, tty).