]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_self_mountinfo.c
eliminated a call to stat() too
[netdata.git] / src / proc_self_mountinfo.c
index 08d5abce117dff3e3b9ac0932a03391342315a9d..8471d407bd4e01c533cfdd957daeaf932afa6040 100644 (file)
@@ -282,7 +282,7 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
                 mi->flags |= MOUNTINFO_IS_REMOTE;
 
             // mark as BIND the duplicates (i.e. same filesystem + same source)
-            {
+            if(do_statvfs) {
                 struct stat buf;
                 if(unlikely(stat(mi->mount_point, &buf) == -1)) {
                     mi->st_dev = 0;
@@ -302,6 +302,9 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
                     }
                 }
             }
+            else {
+                mi->st_dev = 0;
+            }
         }
         else {
             mi->filesystem = NULL;