* dir.cc (readdir_worker): Make static. Only add '.' and '..' when readdir
fails due to ENMFILE. * fhandler_disk_file.cc (fhandler_disk_file::readdir): Only close handle on error != ENMFILE.
This commit is contained in:
parent
4797a77c28
commit
5f5c6f7fa9
|
@ -1,3 +1,10 @@
|
||||||
|
2005-08-22 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* dir.cc (readdir_worker): Make static. Only add '.' and '..' when
|
||||||
|
readdir fails due to ENMFILE.
|
||||||
|
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Only close
|
||||||
|
handle on error != ENMFILE.
|
||||||
|
|
||||||
2005-08-22 Corinna Vinschen <corinna@vinschen.de>
|
2005-08-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* mtinfo.h (mtinfo_drive::error): Fix argument bug in debug_printf call.
|
* mtinfo.h (mtinfo_drive::error): Fix argument bug in debug_printf call.
|
||||||
|
|
|
@ -65,7 +65,7 @@ opendir (const char *name)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
readdir_worker (DIR *dir, dirent *de)
|
readdir_worker (DIR *dir, dirent *de)
|
||||||
{
|
{
|
||||||
myfault efault;
|
myfault efault;
|
||||||
|
@ -80,7 +80,7 @@ readdir_worker (DIR *dir, dirent *de)
|
||||||
|
|
||||||
int res = ((fhandler_base *) dir->__fh)->readdir (dir, de);
|
int res = ((fhandler_base *) dir->__fh)->readdir (dir, de);
|
||||||
|
|
||||||
if (res)
|
if (res == ENMFILE)
|
||||||
{
|
{
|
||||||
if (!(dir->__flags & dirent_saw_dot))
|
if (!(dir->__flags & dirent_saw_dot))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1399,8 +1399,11 @@ fhandler_disk_file::readdir (DIR *dir, dirent *de)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res = geterrno_from_win_error ();
|
res = geterrno_from_win_error ();
|
||||||
|
if (res != ENMFILE)
|
||||||
|
{
|
||||||
FindClose (dir->__handle);
|
FindClose (dir->__handle);
|
||||||
dir->__handle = INVALID_HANDLE_VALUE;
|
dir->__handle = INVALID_HANDLE_VALUE;
|
||||||
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue