summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-09-07 14:51:19 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-09-07 14:51:19 +0200
commit91a64d5ccfd724eda5826b6f02704600a956e12e (patch)
tree468d2d95b6e2481883a7e8d46c19ce7f31d07017 /src/io.c
parentcb22888f08466e46b115bdef6c4ee39b9a2a983e (diff)
parent7dfa6d0b6b18d54050671ed5430b9421a165481c (diff)
Merge branch 'release/debian/3.23-1'debian/3.23-1
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/io.c b/src/io.c
index 6d664d1..6616e88 100644
--- a/src/io.c
+++ b/src/io.c
@@ -39,7 +39,7 @@ struct HXdir {
bool got_first;
#else
DIR *ptr;
- struct dirent dentry; /* must be last */
+ struct dirent *dentry;
#endif
};
@@ -96,7 +96,7 @@ EXPORT_SYMBOL struct HXdir *HXdir_open(const char *s)
*/
name_max = fpathconf(dirfd(tmp_dh), _PC_NAME_MAX);
if (name_max > 0) {
- size -= sizeof(d->dentry) - offsetof(struct dirent, d_name);
+ size -= sizeof(struct dirent) - offsetof(struct dirent, d_name);
size += name_max + 1;
} else {
#ifdef NAME_MAX
@@ -135,13 +135,10 @@ EXPORT_SYMBOL const char *HXdir_read(struct HXdir *d)
}
return d->dentry.cFileName;
#else
- {
- struct dirent *checkptr;
- int i = readdir_r(d->ptr, &d->dentry, &checkptr);
- if (checkptr == NULL || i < 0)
- return NULL;
- }
- return d->dentry.d_name;
+ d->dentry = readdir(d->ptr);
+ if (d->dentry == NULL)
+ return NULL;
+ return d->dentry->d_name;
#endif
}