From 77ccf6540abc0af4deb4d76d7b527b909dde52e3 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 19 Aug 2005 14:40:27 +0000 Subject: [PATCH] fix --- ChangeLog | 5 +++++ lib/fuse.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index c3dbd47..925dbc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-19 Miklos Szeredi + + * lib: always refresh directory contents after rewinddir() to + conform to SUS. Bug found by John Muir. + 2005-08-15 Miklos Szeredi * Released 2.4.0-pre1 diff --git a/lib/fuse.c b/lib/fuse.c index 0f3da23..f9b1543 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -1353,6 +1353,11 @@ static void fuse_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, struct fuse_dirhandle *dh = get_dirhandle(llfi, &fi); pthread_mutex_lock(&dh->lock); + /* According to SUS, directory contents need to be refreshed on + rewinddir() */ + if (!off) + dh->filled = 0; + if (!dh->filled) { int err = readdir_fill(f, ino, size, off, dh, &fi); if (err) { -- 2.30.2