diff --git a/tst/passthrough-fuse/passthrough-fuse.c b/tst/passthrough-fuse/passthrough-fuse.c index f103b3fa..d3a725dd 100644 --- a/tst/passthrough-fuse/passthrough-fuse.c +++ b/tst/passthrough-fuse/passthrough-fuse.c @@ -171,6 +171,7 @@ static int ptfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, fus DIR *dirp = (DIR *)fi->fh; struct dirent *de; + rewinddir(dirp); for (;;) { errno = 0; diff --git a/tst/passthrough-fuse/winposix.c b/tst/passthrough-fuse/winposix.c index 2e27ff2e..a9f7709a 100644 --- a/tst/passthrough-fuse/winposix.c +++ b/tst/passthrough-fuse/winposix.c @@ -355,6 +355,12 @@ DIR *opendir(const char *path) return dirp; } +void rewinddir(DIR *dirp) +{ + if (INVALID_HANDLE_VALUE != dirp->handle) + FindClose(dirp->handle); +} + struct dirent *readdir(DIR *dirp) { WIN32_FIND_DATAA FindData; diff --git a/tst/passthrough-fuse/winposix.h b/tst/passthrough-fuse/winposix.h index e8080310..ff34ce65 100644 --- a/tst/passthrough-fuse/winposix.h +++ b/tst/passthrough-fuse/winposix.h @@ -58,6 +58,7 @@ int mkdir(const char *path, fuse_mode_t mode); int rmdir(const char *path); DIR *opendir(const char *path); +void rewinddir(DIR *dirp); struct dirent *readdir(DIR *dirp); int closedir(DIR *dirp);