@cryptotaxi247 / netdata-1 / commits / 0313ece9a

added error logging in cgroups

Costa Tsaousis (ktsaou) committed Jul 12, 2016 at 16:59 UTC 0313ece9a53bb59de7bda1d525c22c573f27733a
1 file changed +5 -1
src/sys_fs_cgroup.c
+5 -1
@@ -817,7 +817,10 @@ void find_dir_in_subdirs(const char *base, const char *this, void (*callback)(co
817 const char *relative_path = &this[baselen];
818
819 DIR *dir = opendir(this);
820 - if(!dir) return;
820 + if(!dir) {
821 + error("Cannot read cgroups directory '%s'", base);
822 + return;
823 + }
824
825 callback(relative_path);
826
@@ -856,6 +859,7 @@ void find_dir_in_subdirs(const char *base, const char *this, void (*callback)(co
859 find_dir_in_subdirs(base, s, callback);
860 free(s);
861 }
862 + else error("Cannot allocate memory.");
863 }
864 }
865 }