]> arthur.barton.de Git - netdata.git/commitdiff
eliminated a call to stat() too
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 14 Jan 2017 15:00:58 +0000 (17:00 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 14 Jan 2017 15:00:58 +0000 (17:00 +0200)
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;