summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/rewinddir.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2015-05-15 15:49:24 +0000
committerjulian <julian@FreeBSD.org>2015-05-15 15:49:24 +0000
commit821292122271421ddd5428aa2be82c4b7ef04c0f (patch)
tree19a980e4a2a4a547b18b1f52fc3ea044c462d5d9 /lib/libc/gen/rewinddir.c
parent01231d5424a73de86a133ae557ed6c706adcd86f (diff)
downloadFreeBSD-src-821292122271421ddd5428aa2be82c4b7ef04c0f.zip
FreeBSD-src-821292122271421ddd5428aa2be82c4b7ef04c0f.tar.gz
MFH: r282485
Tweak seekdir, telldir and readdir so that when htere are deletes going on, as seek to teh last location saved will still work. This is needed for Samba to be able to correctly handle delete requests from windows. This does not completely fix seekdir when deletes are present but fixes the worst of the problems. The real solution must involve some changes to the API for eh VFS and getdirentries(2). Obtained from: Panzura inc MFH: r282550 (jhb@) A few style fixes and expand the comment a bit on what _fixtelldir() is doing. MFH: r282560 (jhb@) Tweak the comment here some more. In particular, the previous opening sentence was a bit confusing. Noted by: kib
Diffstat (limited to 'lib/libc/gen/rewinddir.c')
-rw-r--r--lib/libc/gen/rewinddir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c
index 193f4b0..e157cd6 100644
--- a/lib/libc/gen/rewinddir.c
+++ b/lib/libc/gen/rewinddir.c
@@ -51,6 +51,7 @@ rewinddir(dirp)
if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);
+ dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */
if (dirp->dd_flags & __DTF_READALL)
_filldir(dirp, false);
else {
OpenPOWER on IntegriCloud