From owner-freebsd-questions@FreeBSD.ORG Thu Dec 6 20:25:41 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB447E82; Thu, 6 Dec 2012 20:25:41 +0000 (UTC) (envelope-from coco@executive-computing.de) Received: from mail.moehre.org (mail.moehre.org [195.96.35.7]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5F08FC14; Thu, 6 Dec 2012 20:25:41 +0000 (UTC) Received: from mail.moehre.org (unknown [195.96.35.7]) by mail.moehre.org (Postfix) with ESMTP id 6EF4C8B14E2; Thu, 6 Dec 2012 21:25:40 +0100 (CET) X-Spam-Flag: NO X-Spam-Score: -100.965 X-Spam-Level: X-Spam-Status: No, score=-100.965 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, AWL=0.035, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mail.moehre.org ([195.96.35.7]) by mail.moehre.org (mail.moehre.org [195.96.35.7]) (amavisd-new, port 10024) with ESMTP id pBDANtI5Uczx; Thu, 6 Dec 2012 21:25:38 +0100 (CET) Received: from [192.168.100.30] (p54B0A324.dip.t-dialin.net [84.176.163.36]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: coco@executive-computing.de) by mail.moehre.org (Postfix) with ESMTPSA id 70FCD8B14E0; Thu, 6 Dec 2012 21:25:38 +0100 (CET) Message-ID: <50C0FF38.4020502@executive-computing.de> Date: Thu, 06 Dec 2012 21:25:28 +0100 From: Marco Steinbach User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: David Xu Subject: Re: grep -Dskip doesn't skip FIFOs References: <50C010D0.3070205@freebsd.org> <50C01518.5090705@freebsd.org> In-Reply-To: <50C01518.5090705@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 20:25:41 -0000 David Xu wrote on 06.12.2012 04:46: > 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. >> >> >> >> 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. This patch also seems to fix it. I can't comment on the patches themselves, though. Anyway, thank you again for taking care of this. MfG CoCo