aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/chgrp.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/chgrp.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/chgrp.c')
-rw-r--r--toys/posix/chgrp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c
index c53ea21d..24af46ac 100644
--- a/toys/posix/chgrp.c
+++ b/toys/posix/chgrp.c
@@ -44,7 +44,7 @@ static int do_chgrp(struct dirtree *node)
// Depth first search
if (!dirtree_notdotdot(node)) return 0;
- if ((flags & FLAG_R) && node->data != -1 && S_ISDIR(node->st.st_mode))
+ if ((flags & FLAG_R) && !node->again && S_ISDIR(node->st.st_mode))
return DIRTREE_COMEAGAIN|((flags&FLAG_L) ? DIRTREE_SYMFOLLOW : 0);
fd = dirtree_parentfd(node);