Re: fts: slightly more robust

2009-09-03 Thread Jim Meyering
Eric Blake wrote: > Eric Blake byu.net> writes: >> Here's the latest draft of my patch. > > While we're at it, I noticed via findutils that fts leaks fds into child > processes. This plugs the fts leak (but completely fixing find also requires > a > patch to findutils). > > Hmm - POSIX states th

Re: fts: slightly more robust

2009-09-02 Thread Eric Blake
Eric Blake byu.net> writes: > Here's the latest draft of my patch. While we're at it, I noticed via findutils that fts leaks fds into child processes. This plugs the fts leak (but completely fixing find also requires a patch to findutils). Hmm - POSIX states that fdopendir can, but not must,

Re: fts: slightly more robust

2009-09-02 Thread Eric Blake
Jim Meyering meyering.net> writes: > > While we're visiting fts, how about this patch? POSIX 2008 is clear that > > opendir should use O_DIRECTORY, so opendirat should probably do likewise. > > There is no need for O_DIRECTORY in that function, since the only thing > it does with the resulting

Re: fts: slightly more robust

2009-09-01 Thread Jim Meyering
Eric Blake wrote: > Jim Meyering meyering.net> writes: >> I suspect that it'd be very hard to trigger these close failures, >> but it's better to be safe. > > While we're visiting fts, how about this patch? POSIX 2008 is clear that > opendir should use O_DIRECTORY, so opendirat should probably do

Re: fts: slightly more robust

2009-09-01 Thread Eric Blake
Jim Meyering meyering.net> writes: > > I suspect that it'd be very hard to trigger these close failures, > but it's better to be safe. While we're visiting fts, how about this patch? POSIX 2008 is clear that opendir should use O_DIRECTORY, so opendirat should probably do likewise. Do we wan

fts: slightly more robust

2009-09-01 Thread Jim Meyering
I suspect that it'd be very hard to trigger these close failures, but it's better to be safe. And along the same lines, since there are more way in which fts_close can fail, encourage callers not to ignore its return value. There were four offenders in coreutils, before today. I chose not to make