Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-01-30 13:30:58 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-01-30 13:30:58 +0300
commit5c25715276e745736cddb8385a239e0d0fa3bd95 (patch)
tree0962ef3efcd0084a70ef8d7cfc561a4b2aba7d2a /winsup/cygwin/fhandler_disk_file.cc
parent2d8319b7e11e63ce4b12f824703975d01dbde34e (diff)
* fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct
clearly from __d_position. Change throughout. (fhandler_disk_file::rewinddir): Reset readdir cache on NT.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 70dff5878..ff4547630 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1362,7 +1362,7 @@ typedef struct __DIR_cache
};
#define d_dirname(d) (((struct __DIR_cache *) (d)->__d_dirname)->__name)
-#define d_pos(d) (((struct __DIR_cache *) (d)->__d_dirname)->__pos)
+#define d_cachepos(d) (((struct __DIR_cache *) (d)->__d_dirname)->__pos)
#define d_cache(d) (((struct __DIR_cache *) (d)->__d_dirname)->__cache)
DIR *
@@ -1397,7 +1397,7 @@ fhandler_disk_file::opendir ()
else
{
strcpy (d_dirname (dir), get_win32_name ());
- d_pos (dir) = 0;
+ d_cachepos (dir) = 0;
dir->__d_dirent->__d_version = __DIRENT_VERSION;
cygheap_fdnew fd;
@@ -1602,9 +1602,9 @@ fhandler_disk_file::readdir (DIR *dir, dirent *de)
if (!wincap.is_winnt ())
return readdir_9x (dir, de);
- /* d_pos always refers to the next cache entry to use. If it's 0, this means
+ /* d_cachepos always refers to the next cache entry to use. If it's 0
we must reload the cache. */
- if (d_pos (dir) == 0)
+ if (d_cachepos (dir) == 0)
{
if ((dir->__flags & dirent_get_d_ino))
{
@@ -1630,11 +1630,11 @@ fhandler_disk_file::readdir (DIR *dir, dirent *de)
if (!status)
{
- buf = (PFILE_ID_BOTH_DIR_INFORMATION) (d_cache (dir) + d_pos (dir));
+ buf = (PFILE_ID_BOTH_DIR_INFORMATION) (d_cache (dir) + d_cachepos (dir));
if (buf->NextEntryOffset == 0)
- d_pos (dir) = 0;
+ d_cachepos (dir) = 0;
else
- d_pos (dir) += buf->NextEntryOffset;
+ d_cachepos (dir) += buf->NextEntryOffset;
if ((dir->__flags & dirent_get_d_ino))
{
FileName = buf->FileName;
@@ -1765,6 +1765,8 @@ fhandler_disk_file::seekdir (DIR *dir, _off64_t loc)
void
fhandler_disk_file::rewinddir (DIR *dir)
{
+ if (wincap.is_winnt ())
+ d_cachepos (dir) = 0;
if (!wincap.is_winnt () && dir->__handle != INVALID_HANDLE_VALUE)
{
if (dir->__handle)