From fec3fd1f8ac1db9ed87b79bd3eb5e38aa835e881 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 26 Jul 2014 13:30:40 -0500 Subject: 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. --- toys/posix/chgrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/chgrp.c') 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); -- cgit v1.2.3