]> arthur.barton.de Git - netdata.git/blobdiff - src/sys_fs_cgroup.c
handle usleep() on systems that do not accept more than 999999 usec; implement altern...
[netdata.git] / src / sys_fs_cgroup.c
index b585376fa2d11b1085b7bd0f4de04d87bdca54e3..5f139c891ee824b220f96b12bbd6ac96a501b1cc 100644 (file)
@@ -252,7 +252,7 @@ void cgroup_read_cpuacct_usage(struct cpuacct_usage *ca) {
                if(!ff) return;
 
                if(procfile_lines(ff) < 1) {
-                       error("File '%s' should have 1+ lines but has %d.", ca->filename, procfile_lines(ff));
+                       error("File '%s' should have 1+ lines but has %u.", ca->filename, procfile_lines(ff));
                        return;
                }
 
@@ -668,6 +668,7 @@ struct cgroup *cgroup_add(const char *id) {
                                !strcmp(chart_id, "systemd") ||
                                !strcmp(chart_id, "system.slice") ||
                                !strcmp(chart_id, "machine.slice") ||
+                               !strcmp(chart_id, "init.scope") ||
                                !strcmp(chart_id, "user") ||
                                !strcmp(chart_id, "system") ||
                                !strcmp(chart_id, "machine") ||
@@ -1274,7 +1275,7 @@ void *cgroups_main(void *ptr)
 
                // delay until it is our time to run
                while((sunow = timems()) < sunext)
-                       usleep((useconds_t)(sunext - sunow));
+                       usecsleep(sunext - sunow);
 
                // find the next time we need to run
                while(timems() > sunext)