summaryrefslogtreecommitdiff
path: root/source4/lib/replace/repdir_getdirentries.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/replace/repdir_getdirentries.c')
-rw-r--r--source4/lib/replace/repdir_getdirentries.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/replace/repdir_getdirentries.c b/source4/lib/replace/repdir_getdirentries.c
index 3079eefed0..33c63c3bcc 100644
--- a/source4/lib/replace/repdir_getdirentries.c
+++ b/source4/lib/replace/repdir_getdirentries.c
@@ -91,7 +91,9 @@ struct dirent *readdir(DIR *dir)
struct dirent *de;
if (d->ofs >= d->nbytes) {
- d->nbytes = getdirentries(d->fd, d->buf, DIR_BUF_SIZE, &d->seekpos);
+ long pos;
+ d->nbytes = getdirentries(d->fd, d->buf, DIR_BUF_SIZE, &pos);
+ d->seekpos = pos;
d->ofs = 0;
}
if (d->ofs >= d->nbytes) {
@@ -121,8 +123,9 @@ long telldir(DIR *dir)
void seekdir(DIR *dir, long ofs)
{
struct dir_buf *d = (struct dir_buf *)dir;
+ long pos;
d->seekpos = lseek(d->fd, ofs & ~(DIR_BUF_SIZE-1), SEEK_SET);
- d->nbytes = getdirentries(d->fd, d->buf, DIR_BUF_SIZE, &d->seekpos);
+ d->nbytes = getdirentries(d->fd, d->buf, DIR_BUF_SIZE, &pos);
d->ofs = 0;
while (d->ofs < (ofs & (DIR_BUF_SIZE-1))) {
if (readdir(dir) == NULL) break;