@cryptotaxi247 / netdata-1 / commits / d78d313b6

eliminated a call to stat() too

Costa Tsaousis (ktsaou) committed Jan 14, 2017 at 17:00 UTC d78d313b67b11e5b7336a16934834255656aa27a
1 file changed +4 -1
src/proc_self_mountinfo.c
+4 -1
@@ -282,7 +282,7 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
282 mi->flags |= MOUNTINFO_IS_REMOTE;
283
284 // mark as BIND the duplicates (i.e. same filesystem + same source)
285 - {
285 + if(do_statvfs) {
286 struct stat buf;
287 if(unlikely(stat(mi->mount_point, &buf) == -1)) {
288 mi->st_dev = 0;
@@ -302,6 +302,9 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
302 }
303 }
304 }
305 + else {
306 + mi->st_dev = 0;
307 + }
308 }
309 else {
310 mi->filesystem = NULL;