Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Dec 2012 11:46:32 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Marco Steinbach <coco@executive-computing.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: grep -Dskip doesn't skip FIFOs
Message-ID:  <50C01518.5090705@freebsd.org>
In-Reply-To: <50C010D0.3070205@freebsd.org>
References:  <alpine.BSF.2.00.1212052350170.36676@probsd.c0c0.intra> <50C010D0.3070205@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2012/12/06 11:28, David Xu wrote:
> On 2012/12/06 07:07, Marco Steinbach wrote:
>> Hi there,
>>
>> grep(1) does not seem to skip FIFOs when told to.
>
> <snip>
>
> I think you need a patch to fix it, the bug is in ggrep, it tries to
> open a FIFO before checking if it is a FIFO, then blocked.
>
> http://people.freebsd.org/~davidxu/patch/grep.c.diff
>
> _______________________________________________

>

or the patch:
http://people.freebsd.org/~davidxu/patch/grep.c.diff2

The patch opens file with O_NONBLOCK, then turns off O_NONBLOCK,
and only checks if a file is a FIFO in reset() function.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50C01518.5090705>