aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-04-21 17:46:25 -0500
committerRob Landley <rob@landley.net>2016-04-21 17:46:25 -0500
commitbb77dde5ddfba8fe0c819b18b547c2d710956502 (patch)
tree50948a567f42b7be3ce648eb3045b9db2961db10 /toys/posix
parent00385e8d0e1f83a58710ada4a210d15102542b7d (diff)
downloadtoybox-bb77dde5ddfba8fe0c819b18b547c2d710956502.tar.gz
Have dirtree_recurse() take the new dirfd as an argument.
Diffstat (limited to 'toys/posix')
-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