bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paul Eggert
Subject: bug#74159: Unexpected exit code of 0 when -q is set and close_stdout fails
Date: Fri, 1 Nov 2024 23:02:11 -0700
User-agent: Mozilla Thunderbird

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 see other consequences of the mistake. Fixed in the attached patch (with a test case that's unlike your problem); please give it a try.

That being said, the lower levels of your OS appear to be buggy, as 'close' should not fail with EACCES. I wouldn't be surprised if other software breaks because of this issue. So I suggest also reporting a bug to whoever maintains the NFS client code that you're using.

I'm boldly closing this bug report; we can reopen it if the patch doesn't work for you.

Attachment: 0001-grep-fix-q-suppression-of-diagnostics.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]