bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug #17457: "grep -r foo . > somefile" goes into an infinite loop


From: Jim Meyering
Subject: Re: bug #17457: "grep -r foo . > somefile" goes into an infinite loop
Date: Sun, 24 Jul 2011 21:06:02 +0200

Paolo Bonzini wrote:
> On 07/23/2011 11:12 PM, Jim Meyering wrote:
>>
>> In my experience, dev/ino is sufficient, as long as you're not using one of
>> a few POSIX-violating fringe file systems (clearcase's MVS comes to mind).
>
> What about a few POSIX-violating fringe operating systems (Windows and
> DJGPP come to mind)? :)  For Windows we can write our own stat
> function in cygwin, but for DJGPP I think we're in a bad situation...

AFAIK, DJGPP is not relevant these days.
What Windows environment are you worried about?  As far as I know, the
vast majority of sys/fs pairs in use today have usable dev/ino.  There
used to be support in GNU rm for systems that lack useful stat.st_ino
(it was 0 for every file), but when that and st_dev became important
enough from a security/reliability standpoint, I ended up removing the
work-around code.  No one has mentioned it for at least 3 or 4 years.

IMHO, any system without usable dev/ino is not a reasonable
portability target.

> The attribute tests fix it in practice, but since this is not an
> optimization, perhaps gnulib's SAME_INODE module should provide an
> indicator of the reliability of the macro.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]