From: Erik Faye-Lund Date: Fri, 18 Jun 2010 13:26:20 GMT Subject: Re: [PATCH] Fix 'git clean' failure on NFS. Message-ID: In-Reply-To: <4C1B6E13.1030309@gmail.com> 2010/6/18 Török Edwin : > On 06/18/2010 03:29 PM, Erik Faye-Lund wrote: >> 2010/6/18 Török Edwin : >>> readdir() used to do a single pass, which is not always enough. >>> If you unlink some files/rmdir some subdirs then there might be some >>> files you haven't seen yet *before* the readdir cursor (files get rearranged >>> in the directory, etc.). >>> >>> The fix is to do an additional readdir() pass if we unlinked/rmdired something. >>> This is easily accomplished by using rewinddir. >>> >> >> Won't this break on Windows? mingw_readdir() doesn't seem to have a >> maching mingw_rewinddir() in compat/mingw.c/h.... >> > > rewinddir() is used in ClamAV too, and it builds natively on win32. > I think we have some compat function that map rewinddir to the Win32 > API, somebody will probably have to do that for git too. > There's a rewinddir function in msvcrt.dll. However, we're not using msvcrt.dll's opendir() implementation for performance reasons, so this patch would require a rewinddir implementation as a preparation path, no? If such a patch could be extracted from ClamAV (and ClamAV is license compatible with git), would you mind including such a patch for the next round? > Another possibility is to do closedir/opendir again on mingw. Yes. Yet another possibility is to enable the NO_MINGW_REPLACE_READDIR-switch, but this has negative performance effects... -- Erik "kusma" Faye-Lund