diff options
author | Rob Landley <rob@landley.net> | 2014-07-26 13:30:40 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-07-26 13:30:40 -0500 |
commit | fec3fd1f8ac1db9ed87b79bd3eb5e38aa835e881 (patch) | |
tree | a7e149cf0fefef5d252706797fff8c831ebb0460 /toys/posix/chgrp.c | |
parent | ccb73f8bf9191c01c90975958a210c47175bd98c (diff) | |
download | toybox-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.c | 2 |
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); |