>> 2. Can a cg_destroy() call ever work as expected if a cg_create() call failed? > > Perhaps next time you can answer your own question by spending 30 > seconds actually reading the code you're "fixing": > > int cg_destroy(const char *cgroup) > { … > ret = rmdir(cgroup); … > if (ret && errno == ENOENT) <<< that case is explicitly handled here > ret = 0; > > return ret; > } Is it interesting somehow that a non-existing directory (which would occasionally not be found) is tolerated so far? https://elixir.bootlin.com/linux/v6.3-rc3/source/tools/testing/selftests/cgroup/cgroup_util.c#L285 Should such a function call be avoided because of a failed cg_create() call? Regards, Markus