Skip to content

Fix broken pipe error, issue #192#195

Open
GunterSchmidt wants to merge 2 commits intouutils:mainfrom
GunterSchmidt:SIGPIPE-panic-on-broken-pipe
Open

Fix broken pipe error, issue #192#195
GunterSchmidt wants to merge 2 commits intouutils:mainfrom
GunterSchmidt:SIGPIPE-panic-on-broken-pipe

Conversation

@GunterSchmidt
Copy link
Contributor

@GunterSchmidt GunterSchmidt commented Mar 9, 2026

Fixes #192 with code used in coreutils.

@GunterSchmidt
Copy link
Contributor Author

This fix will return

>diffutils diff /etc/pacman.conf /dev/null | :
diffutils: write error: Broken pipe

while GNU diff does suppresses it completely.

This could easily be changed, but I prefer to output this error message.

Reason: Using diff on different files should return exit code 1, but returns in this case 0 without an error message. This is completely wrong information to the user.

This version sets exit code 1, which seems correct, since |: would not produce an error if no output was written as in the equal case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGPIPE panics

1 participant