aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index bec76e99..2ebc062a 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -337,8 +337,8 @@ static void listfiles(int dirfd, struct dirtree *indir)
} else {
// Read directory contents. We dup() the fd because this will close it.
// This reads/saves contents to display later, except for in "ls -1f" mode.
- indir->dirfd = dup(dirfd);
- dirtree_recurse(indir, filter, DIRTREE_SYMFOLLOW*!!(flags&FLAG_L));
+ dirtree_recurse(indir, filter, dup(dirfd),
+ DIRTREE_SYMFOLLOW*!!(flags&FLAG_L));
}
// Copy linked list to array and sort it. Directories go in array because