On Thu, May 14, 2009 at 9:42 AM, Dhaval Giani <[email protected]> wrote: > Introduce a cgroup_tree_handle structure so that we can track flags for > the walk_tree operation. In a number of cases we would prefer to walk the > tree in postorder as opposed to pre-order which is the current default. > This patch does the addition. > > Signed-off-by: Dhaval Giani <[email protected]> > d> =================================================================== > --- libcg.orig/src/api.c > +++ libcg/src/api.c > > +int cgroup_walk_tree_set_flags(void **handle, int flags) > +{ > + struct cgroup_tree_handle *entry; > + > + if (!cgroup_initialized) > + return ECGROUPNOTINITIALIZED; > + > + if ((flags & CGROUP_WALK_TYPE_PRE_DIR) && > + (flags & CGROUP_WALK_TYPE_POST_DIR)) > + return ECGINVAL; > + > + entry = (struct cgroup_tree_handle *) *handle; > + entry->flags = flags; > + > + *handle = entry;
Don't want to check !handle before using the handle ? Similarly for cgroup_get_task_begin() and cgroup_walk_tree_begin(). Regards, Bharata. -- http://bharata.sulekha.com/blog/posts.htm ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
