[lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support
Christian Seiler
christian at iwakd.de
Wed Sep 11 21:07:52 UTC 2013
Hi Serge,
Sorry about 'ns' support in my rewrite, I completely forgot that it's
removal was not so long ago.
I have a two very minor nit-picky comments:
> +static char *cgroup_rename_nsgroup(char *mountpath, const char *oldname, int pid, const char *name)
> +lxc_cgroup_create(..., int pid)
pid_t instead of int would be a better idea for pid. Also, mountpath in
the first function should probably be const to indicate it's contents
won't be modified.
> + fulloldpath = alloca(strlen(oldname) + strlen(mountpath) + 22);
> + sprintf(fulloldpath, "%s/%s/%d", mountpath, oldname, pid);
Even though you allocated a correctly-sized buffer, I'd personally
prefer to always use snprintf to be on the safe side...
-- Christian
More information about the lxc-devel
mailing list