]> arthur.barton.de Git - netdata.git/commitdiff
fix for invalid JSON generation #329, #347
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 1 May 2016 18:35:05 +0000 (21:35 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 1 May 2016 18:35:05 +0000 (21:35 +0300)
src/sys_fs_cgroup.c

index 425471548fedeac0cab2d8814ae685b15d9f98ab..38fddcda7ee71c2160f46754c4f679afa5d56e93 100644 (file)
@@ -614,13 +614,15 @@ void cgroup_get_chart_id(struct cgroup *cg) {
                if(!cg->chart_title)
                        fatal("CGROUP: Cannot allocate memory for chart name of cgroup '%s' chart name: '%s'", cg->id, s);
 
-               netdata_fix_chart_id(s);
+               netdata_fix_chart_name(cg->chart_title);
 
                free(cg->chart_id);
                cg->chart_id = strdup(s);
                if(!cg->chart_id)
                        fatal("CGROUP: Cannot allocate memory for chart id of cgroup '%s' chart id: '%s'", cg->id, s);
 
+               netdata_fix_chart_id(cg->chart_id);
+
                debug(D_CGROUP, "cgroup '%s' renamed to '%s' (title: '%s')", cg->id, cg->chart_id, cg->chart_title);
        }
        else debug(D_CGROUP, "cgroup '%s' is not to be renamed (will be shown as '%s')", cg->id, cg->chart_id);