[cgmanager-devel] [PATCH] setup_cgroup_mounts: fix return value
Serge Hallyn
serge.hallyn at ubuntu.com
Mon Dec 16 13:33:44 UTC 2013
Quoting Libo Chen (clbchenlibo.chen at huawei.com):
>
> if return value of snprintf >= MAXPATHLEN, main routine will mistake
> setup_cgroup_mounts succeed
>
> Signed-off-by: Libo Chen <clbchenlibo.chen at huawei.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
thanks.
> ---
> fs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs.c b/fs.c
> index fbc152e..645cd59 100644
> --- a/fs.c
> +++ b/fs.c
> @@ -175,6 +175,7 @@ int setup_cgroup_mounts(void)
> ret = snprintf(dest, MAXPATHLEN, "%s/%s", base_path, line);
> if (ret < 0 || ret >= MAXPATHLEN) {
> nih_fatal("Error calculating pathname for %s and %s", base_path, line);
> + ret = -1;
> goto out;
> }
> if (mkdir(dest, 0755) < 0 && errno != EEXIST) {
> --
> 1.8.2.2
>
More information about the cgmanager-devel
mailing list