diff toys/chgrp.c @ 589:7013fd450ff4

Changed my mind about the design again, now callback is dirtree_opennode() and recursion choice is how caller interprets flags.
author Rob Landley <rob@landley.net>
date Fri, 01 Jun 2012 20:27:51 -0500
parents 9c2277b92b86
children 8bee9c27c219
line wrap: on
line diff
--- a/toys/chgrp.c	Fri Jun 01 20:04:39 2012 -0500
+++ b/toys/chgrp.c	Fri Jun 01 20:27:51 2012 -0500
@@ -42,8 +42,8 @@
 {
 	int ret, flags = toys.optflags;
 
-	ret = dirtree_comeagain(node, flags & FLAG_R);
-	if (!ret || ret == DIRTREE_COMEAGAIN) return ret;
+	ret = dirtree_opennode(node);
+	if (!ret || ((flags & FLAG_R) && ret == DIRTREE_COMEAGAIN)) return ret;
 
 	if (node->extra != -1) ret = fchown(node->extra, -1, TT.group);