-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fail!() writes to stderr #374
Comments
Not every call to I added |
Using set_stderr is the simpler solution. You only have to do this in mkmain.rs and src/uutils/uutils.rs. You can also use libc::?::signal to turn on sigpipe's default behavior. |
I don't think we want to ignore an occurrence of I hadn't thought about using |
I think this can be fixed by just adding |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
fail! writes an error message to stderr. Every function call that can fail is a potential rust error message to stderr. Consider the following code
This is not how cat should behave. There are currently 129 calls to unwrap() in coreutils.
There is currently no way to make fail! simply call abort which would probably be sufficient for coreutils. You can use stdio::set_stderr to set the writer used by fail!() or you can remove every call that can fail.
Note that println! will also call fail on sigpipe. There are currently 420 occurrences of println!.
The text was updated successfully, but these errors were encountered: