diff options
Diffstat (limited to 'source4/lib/replace/repdir_getdirentries.c')
-rw-r--r-- | source4/lib/replace/repdir_getdirentries.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/lib/replace/repdir_getdirentries.c b/source4/lib/replace/repdir_getdirentries.c index a9c1c1ce82..9e4b63145c 100644 --- a/source4/lib/replace/repdir_getdirentries.c +++ b/source4/lib/replace/repdir_getdirentries.c @@ -48,6 +48,7 @@ well. Contact the author. */ +#include "replace.h" #include <stdlib.h> #include <sys/stat.h> #include <unistd.h> @@ -104,8 +105,6 @@ struct dirent *readdir(DIR *dir) return de; } -#define TELLDIR_TAKES_CONST_DIR - #ifdef TELLDIR_TAKES_CONST_DIR long telldir(const DIR *dir) #else @@ -126,7 +125,11 @@ long telldir(DIR *dir) return d->seekpos + d->ofs; } +#ifdef SEEKDIR_RETURNS_INT +int seekdir(DIR *dir, long ofs) +#else void seekdir(DIR *dir, long ofs) +#endif { struct dir_buf *d = (struct dir_buf *)dir; long pos; @@ -136,6 +139,9 @@ void seekdir(DIR *dir, long ofs) while (d->ofs < (ofs & (DIR_BUF_SIZE-1))) { if (readdir(dir) == NULL) break; } +#ifdef SEEKDIR_RETURNS_INT + return -1; +#endif } void rewinddir(DIR *dir) |