Skip to content

Commit

Permalink
fs-posix: Fix iterating directories when readdir() returns DT_UNKNOWN
Browse files Browse the repository at this point in the history
Files were iterated correctly, but directories weren't. This mainly broke
directory iteration with NFS when nordirplus mount option was used.
  • Loading branch information
sirainen authored and villesavolainen committed Feb 9, 2018
1 parent 1aed9cf commit 8933d76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib-fs/fs-posix.c
Expand Up @@ -844,9 +844,9 @@ static const char *fs_posix_iter_next(struct fs_iter *_iter)
#ifdef HAVE_DIRENT_D_TYPE
switch (d->d_type) {
case DT_UNKNOWN:
if (!fs_posix_iter_want(iter, d->d_name))
break;
/* fall through */
if (fs_posix_iter_want(iter, d->d_name))
return d->d_name;
break;
case DT_REG:
case DT_LNK:
if ((iter->iter.flags & FS_ITER_FLAG_DIRS) == 0)
Expand Down

0 comments on commit 8933d76

Please sign in to comment.