bug#74159: Unexpected exit code of 0 when -q is set and close_stdout fails

2024-11-01 Thread Jan Černohorský
Hello, I've encountered a particularly interesting bug in GNU grep yesterday while hunting some issues with LibreOffice (if you're interested in the whole post-mortem, it can be read here: https://grsc.cz/blog/loffice-linux-issues/, but it's mostly not relevant for this bug). Whenever the `

bug#74159: Unexpected exit code of 0 when -q is set and close_stdout fails

2024-11-01 Thread Paul Eggert
On 2024-11-01 06:10, Jan Černohorský wrote: when the `-q` option is detected (grep.c:2697), the `exit_failure` variable is set to 0. This causes any error, when not specially handled, to exit with 0, even before any match is found. Yes, that's a mistake. I can't reproduce your bug but I can