Bug 192579 - named pipe vs "grep -sr"
Summary: named pipe vs "grep -sr"
Keywords:
Status: CLOSED DUPLICATE of bug 189580
Alias: None
Product: Fedora
Classification: Fedora
Component: grep
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-20 22:31 UTC by John Reiser
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-05-21 09:44:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Reiser 2006-05-20 22:31:46 UTC
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 09:44:37 UTC
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.