* syscalls.cc (check_dir_not_empty): Never count more than 3 directory

entries.
This commit is contained in:
Corinna Vinschen 2010-12-12 15:32:45 +00:00
parent f646aeb049
commit e52961c403
2 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2010-12-12 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (check_dir_not_empty): Never count more than 3 directory
entries.
2010-12-12 Christopher Faylor <me+cygwin@cgf.cx>
* init.cc (search_for): Put this in shared section or suffer subtle

View File

@ -514,14 +514,13 @@ check_dir_not_empty (HANDLE dir)
int cnt = 1;
while (pfni->NextEntryOffset)
{
if (++cnt > 2)
{
syscall_printf ("Directory not empty");
return STATUS_DIRECTORY_NOT_EMPTY;
}
pfni = (PFILE_NAMES_INFORMATION)
((caddr_t) pfni + pfni->NextEntryOffset);
++cnt;
}
if (cnt > 2)
{
syscall_printf ("Directory not empty");
return STATUS_DIRECTORY_NOT_EMPTY;
}
return STATUS_SUCCESS;
}