aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/du.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-07-26 13:30:40 -0500
committerRob Landley <rob@landley.net>2014-07-26 13:30:40 -0500
commitfec3fd1f8ac1db9ed87b79bd3eb5e38aa835e881 (patch)
treea7e149cf0fefef5d252706797fff8c831ebb0460 /toys/posix/du.c
parentccb73f8bf9191c01c90975958a210c47175bd98c (diff)
downloadtoybox-fec3fd1f8ac1db9ed87b79bd3eb5e38aa835e881.tar.gz
Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
Diffstat (limited to 'toys/posix/du.c')
-rw-r--r--toys/posix/du.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/du.c b/toys/posix/du.c
index 2bfa7e41..22a26d3a 100644
--- a/toys/posix/du.c
+++ b/toys/posix/du.c
@@ -111,12 +111,12 @@ static int do_du(struct dirtree *node)
return 0;
// Don't count hard links twice
- if (!(toys.optflags & FLAG_l) && node->data != -1)
+ if (!(toys.optflags & FLAG_l) && !node->again)
if (seen_inode(&TT.inodes, &node->st)) return 0;
// Collect child info before printing directory size
if (S_ISDIR(node->st.st_mode)) {
- if (node->data != -1) {
+ if (!node->again) {
TT.depth++;
return DIRTREE_COMEAGAIN | (DIRTREE_SYMFOLLOW*!!(toys.optflags & FLAG_L));
} else TT.depth--;