comparison 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
comparison
equal deleted inserted replaced
588:9c2277b92b86 589:7013fd450ff4
40 40
41 static int do_chgrp(struct dirtree *node) 41 static int do_chgrp(struct dirtree *node)
42 { 42 {
43 int ret, flags = toys.optflags; 43 int ret, flags = toys.optflags;
44 44
45 ret = dirtree_comeagain(node, flags & FLAG_R); 45 ret = dirtree_opennode(node);
46 if (!ret || ret == DIRTREE_COMEAGAIN) return ret; 46 if (!ret || ((flags & FLAG_R) && ret == DIRTREE_COMEAGAIN)) return ret;
47 47
48 if (node->extra != -1) ret = fchown(node->extra, -1, TT.group); 48 if (node->extra != -1) ret = fchown(node->extra, -1, TT.group);
49 49
50 if (ret || (flags & FLAG_v)) { 50 if (ret || (flags & FLAG_v)) {
51 char *path = dirtree_path(node, 0); 51 char *path = dirtree_path(node, 0);