Packages::DoSearchContents: Avoid breaking the grep pipe
authorFrank Lichtenheld <frank@lichtenheld.de>
Tue, 18 Sep 2007 16:04:24 +0000 (18:04 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Tue, 18 Sep 2007 16:04:24 +0000 (18:04 +0200)
Since grep doesn't handle SIGPIPE in any sane way but instead
clutters the error.log with useless comments like
"grep: writing output: Broken pipe" for each and every line it
wants to write, lets make it happy and read all the stuff in even
if we don't use it.

lib/Packages/DoSearchContents.pm

index 7054bb90c1ff7904c9ae6483d0894b090fb38f38..1be7d441cc90e25c6da65a0b855a2916d809e8ff 100644 (file)
@@ -75,6 +75,7 @@ sub do_search_contents {
                &searchfile(\@results, reverse($_)."/", \$nres, $reverses);
                last if $Packages::Search::too_many_hits;
            }
+           while (<FILENAMES>) {};
            close FILENAMES or warn "fgrep error: $!\n";
        } else {