cat: Suppress Broken Pipe errors.
At present, the cat command unexpectedly prints an error message when it receives a broken pipe error.
As an example, there are many workflows that make use of cat and head together to process only part of the data. The head command will stop reading after a configured number of bytes or lines, subsequently exposing cat to a broken pipe condition.
Said workflows may fail when they unexpectedly get error messages in their output.
Suppress broken pipe errors.
GNU testsuite comparison:
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
The Android / Test builds (ubuntu-latest, 4, 4096, 28, google_apis_playstore, x check appears to have failed intermittently during initialization and might be unrelated to the change at hand?
@fnordahl yes, it looks unrelated. Anyway, I restarted it.
This was superseded by #8336 I believe sand is no longer needed
Awesome, great that it was eventually fixed @julian-klode.
Curious about the choice of messing with std::io signal handling as opposed to just checking error return of std::io functions, which already handles the signal, but as long as I don't get broken pipes in cat output I'm happy!