fails due to ENMFILE.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Only close handle on
error != ENMFILE.
+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>
* mtinfo.h (mtinfo_drive::error): Fix argument bug in debug_printf call.
return res;
}
-int
+static int
readdir_worker (DIR *dir, dirent *de)
{
myfault efault;
int res = ((fhandler_base *) dir->__fh)->readdir (dir, de);
- if (res)
+ if (res == ENMFILE)
{
if (!(dir->__flags & dirent_saw_dot))
{
else
{
res = geterrno_from_win_error ();
- FindClose (dir->__handle);
- dir->__handle = INVALID_HANDLE_VALUE;
+ if (res != ENMFILE)
+ {
+ FindClose (dir->__handle);
+ dir->__handle = INVALID_HANDLE_VALUE;
+ }
goto out;
}
}