summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-14 02:37:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:37 -0500
commitbdfecf3c9777bac276eb3d257ef55728e5dcc6ca (patch)
tree66e6ea45f22b704e219d3bd06bb2929a0f033772
parentae984783858b14e770e44343df04b7576be6d6a1 (diff)
downloadsamba-bdfecf3c9777bac276eb3d257ef55728e5dcc6ca.tar.gz
samba-bdfecf3c9777bac276eb3d257ef55728e5dcc6ca.tar.bz2
samba-bdfecf3c9777bac276eb3d257ef55728e5dcc6ca.zip
r18493: another "blind coding" attempt at a getdirentries() based readdir()
replacement (This used to be commit 94b73d692bf85604c7be811bad0b8c6a08b18103)
-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;