Bug 192579 - named pipe vs "grep -sr"
named pipe vs "grep -sr"
Status: CLOSED DUPLICATE of bug 189580
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-20 18:31 EDT by John Reiser
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-21 05:44:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Reiser 2006-05-20 18:31:46 EDT
Description of problem:
A named pipe interferes with the use of "grep -sr <term> <directory>" to search
an entire directory tree in a reliable way.

Version-Release number of selected component (if applicable):
grep-2.5.1-52.2

How reproducible:
Always

Steps to Reproduce:
1. mkdir dir1
2. cd dir1; mkfifo fifo
3. cd ..; grep -sr foo . &
4. strace -p <pid-of-grep-above>
  
Actual results:
$ strace -p 3044
Process 3044 attached - interrupt to quit
open("dir1/fifo", O_RDONLY|O_LARGEFILE
## This shows that grep is blocked waiting for the fifo.

Expected results:
Under flags "-sr", grep should not wait for fifos.  Grep should ignore an empty
fifo entirely; and read a non-empty fifo with non-blocking I/O, and assume
End-of-File as soon as the read() returns 0 or -1.  Or, there should be another
command-line flag to specify the behavior "don't wait for fifos", so that there
is some reliable way to search a directory tree for strings.

Additional info:
Comment 1 Tim Waugh 2006-05-21 05:44:37 EDT
In theory, '-D skip' is the option you want.  In practice, it's broken. :-/

*** This bug has been marked as a duplicate of 189580 ***

Note You need to log in before you can comment on or make changes to this bug.