summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/telldir.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/dirent/telldir.c')
-rw-r--r--libc/misc/dirent/telldir.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/libc/misc/dirent/telldir.c b/libc/misc/dirent/telldir.c
index 8c13a9c23..124030431 100644
--- a/libc/misc/dirent/telldir.c
+++ b/libc/misc/dirent/telldir.c
@@ -6,31 +6,11 @@
long int telldir(DIR * dir)
{
- off_t offset;
-
if (!dir) {
__set_errno(EBADF);
return -1;
}
- switch (dir->dd_getdents) {
- case no_getdents:
- /* We are running the old kernel. This is the starting offset
- of the next readdir(). */
- offset = lseek(dir->dd_fd, 0, SEEK_CUR);
- break;
-
- case unknown:
- /* readdir () is not called yet. but seekdir () may be called. */
- case have_getdents:
- /* The next entry. */
- offset = dir->dd_nextoff;
- break;
-
- default:
- __set_errno(EBADF);
- offset = -1;
- }
-
- return offset;
+ /* The next entry. */
+ return dir->dd_nextoff;
}