]> arthur.barton.de Git - netdata.git/commitdiff
added error logging in cgroups
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 12 Jul 2016 13:59:23 +0000 (16:59 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Tue, 12 Jul 2016 13:59:23 +0000 (16:59 +0300)
src/sys_fs_cgroup.c

index 87fe793944c61679439970a99f94a19fb9cd04ec..72ee2f3b38eb73519267df62d4f3862ef31fcd72 100644 (file)
@@ -817,7 +817,10 @@ void find_dir_in_subdirs(const char *base, const char *this, void (*callback)(co
        const char *relative_path = &this[baselen];
 
        DIR *dir = opendir(this);
-       if(!dir) return;
+       if(!dir) {
+               error("Cannot read cgroups directory '%s'", base);
+               return;
+       }
 
        callback(relative_path);
 
@@ -856,6 +859,7 @@ void find_dir_in_subdirs(const char *base, const char *this, void (*callback)(co
                                        find_dir_in_subdirs(base, s, callback);
                                        free(s);
                                }
+                               else error("Cannot allocate memory.");
                        }
                }
        }