diff options
author | Rob Landley <rob@landley.net> | 2016-04-21 17:46:25 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-04-21 17:46:25 -0500 |
commit | bb77dde5ddfba8fe0c819b18b547c2d710956502 (patch) | |
tree | 50948a567f42b7be3ce648eb3045b9db2961db10 /toys/posix/ls.c | |
parent | 00385e8d0e1f83a58710ada4a210d15102542b7d (diff) | |
download | toybox-bb77dde5ddfba8fe0c819b18b547c2d710956502.tar.gz |
Have dirtree_recurse() take the new dirfd as an argument.
Diffstat (limited to 'toys/posix/ls.c')
-rw-r--r-- | toys/posix/ls.c | 4 |
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 |