seq: returning exit code 1 on broken pipe, fixes seq-epipe#9631
seq: returning exit code 1 on broken pipe, fixes seq-epipe#9631ChrisDryden wants to merge 1 commit intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
There must have been a misunderstanding in the original code before this change. GNU seq never returns 0 upon pipe error. The shell implicitly handles SIGPIPE result from any command, which I guess is the source of the misunderstanding. For the record seq (or any properly behaving unix command) returns failure upon any pipe error. See: pipes being central to the unix model, this is a critical thing to get right, |
|
Started working on a draft that is way more comprehensive and is able to pass all of the GNU pipe signal related tests based on @mattsu2020 's handler #9646 will be separating the shared library and the seq fixes into a separate PR |
Work in progress for me trying to understand the whole EPIPE situation, on one hand the GNU implementation is supposed to clearly return a 1 in this case, but when the ignore sigpipe is set it should return 0 and we don't have that in any of the utilities. I think the plan could be set this for now and when the library that all of the utilities use for ignoring the sig-pipe is made we add it here.