On 08/18/2011 09:19 PM, Serge E. Hallyn wrote: > Hi, > > cgclear seems to assume that the system is frozen while it does its thing. > I need the following patch in order to get cgclear to both catch all tasks, > and not spuriously fail bc some task exited. > > Is there another way you'd prefer to do this? > > -serge >
> ++again: > + /* > + * Open tasks file of the group to delete. > + */ > +@@ -1748,6 +1758,9 @@ > + > + ret = rmdir(path); > + if (ret != 0&& errno != ENOENT) { > ++ if (errno == EBUSY) > ++ // more tasks have come up > ++ goto again; > + last_errno = errno; > + return ECGOTHER; This can easily turn into endless loop. IMHO it would be better to try it only few times and maybe only if a new flag is provided to cgroup_delete_cgroup_ext(). The function could return something like ECGAGAIN if several retries failed, so the caller knows what is going on and can either retry by itself or report something to user. Jan ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel