bug-coreutils
[Top][All Lists]
Advanced

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

Re: problem with readdir in Darwin-6.5?


From: Paul Eggert
Subject: Re: problem with readdir in Darwin-6.5?
Date: 01 May 2003 13:43:17 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Jim Meyering <address@hidden> writes:

> I just went to remove a directory on a local `hfs' file system from a
> powerpc-apple-darwin6.5 system and was surprised to see the `rm -rf' fail.

Wow, a local filesystem?  FreeBSD bug kern/26142 says only that the
bug occurs with an NFS filesystem.

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/26142


> Here's a demo:

Perhaps you should submit your demo to the FreeBSD folks, as a
followup to that bug.  They might raise the priority of fixing
kern/26142.  That bug was filed over two years ago, with Severity
"serious" and Priority "medium".  Your demo might talk them into
raising the priority.

> I don't want yet another configure-time test for broken readdir
> (SunOS had a problem very much like this long ago, but I obviated
> the work-around code when I rewrote rm).

I don't see any other alternative, other than something even worse
like "#ifdef FreeBSD".

> The work-around here is probably to call rewinddir from a readdir
> wrapper to be used only on deficient systems.

26142 gives the workaround "Call rewinddir after each unlink call".
Is that what you mean?  Or were you just going to call rewinddir after
readdir returns NULL?

> But then do we do the extra rewinddir unconditionally, or add
> bookkeeping so we incur the cost only if we've removed more than
> some minimum number of entries in a given directory.

I would avoid the bookkeeping.  Just call rewinddir before each
readdir.  Safe and simple.  (Only on buggy systems, of course.)




reply via email to

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