From: Weng Meiling Date: Tue, 25 Jun 2013 07:53:22 +0000 (+0200) Subject: cgsnapshot: fix the print message when use cgsnapshot with -f X-Git-Tag: v0.41~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a33777ae0beca810283f670d10d59d69bf82b35;p=thirdparty%2Flibcgroup.git cgsnapshot: fix the print message when use cgsnapshot with -f When use cgsnapshot with -f to save current configuration of cgroups, the mount section is missing, this patch fix it. the example as following: # cgsnapshot -s -f config cpu = /cgroup/cpu; # cat config # Configuration file generated by cgsnapshot mount { } group test { cpu { cpu.rt_period_us="1000000"; cpu.rt_runtime_us="0"; cpu.cfs_period_us="100000"; cpu.cfs_quota_us="-1"; cpu.shares="1024"; } } Signed-off-by: Weng Meiling Acked-by: Ivana Hutarova Varekova --- diff --git a/src/tools/cgsnapshot.c b/src/tools/cgsnapshot.c index 324f93b5..8217798f 100644 --- a/src/tools/cgsnapshot.c +++ b/src/tools/cgsnapshot.c @@ -610,9 +610,9 @@ static int show_mountpoints(const char *controller) while (ret == 0) { if (quote) - printf("\t\"%s\" = %s;\n", controller, path); + fprintf(of, "\t\"%s\" = %s;\n", controller, path); else - printf("\t%s = %s;\n", controller, path); + fprintf(of, "\t%s = %s;\n", controller, path); ret = cgroup_get_subsys_mount_point_next(&handle, path); } cgroup_get_subsys_mount_point_end(&handle);