]> granicus.if.org Git - sysstat/commitdiff
Merge branch 'odubaj-autofs-not-counting'
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 16 Mar 2019 09:43:18 +0000 (10:43 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 16 Mar 2019 09:43:18 +0000 (10:43 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
1  2 
count.c
rd_stats.c

diff --cc count.c
index 03469b0bf29716d5040cc361fbee80633b7ba9e4,3890e924b8ed0ae97d8b2f92245dff321a71f741..35a1990b8e2f9ec07fbe7ca372daa04aebde6521
+++ b/count.c
@@@ -491,6 -491,19 +491,19 @@@ __nr_t get_filesystem_nr(void
                        if (pos == NULL)
                                continue;
  
 -                      /*      
++                      /*
+                        * Find second field separator position,
+                        * read filesystem type,
 -                       * if filesystem type is autofs, skip it 
++                       * if filesystem type is autofs, skip it
+                       */
+                       pos2 = strchr(pos + 1, ' ');
+                       if (pos2 == NULL)
+                               continue;
 -                      
++
+                       sscanf(pos2 + 1, "%127s", type);
+                       if(strcmp(type, "autofs") == 0)
+                               continue;
                        /* Read filesystem name and mount point */
                        sscanf(line, "%127s", fs_name);
                        sscanf(pos + 1, "%255s", mountp);
diff --cc rd_stats.c
index 61dc95852ffec31563d88845e8ba417e8f322a16,d49aec00b3721a1b18fa4aedf678e70cd6154963..d62830cdfb63ff03ce2719e0c2758d0f97fdb58b
@@@ -2464,10 -2464,10 +2464,10 @@@ __nr_t read_bus_usb_dev(struct stats_pw
  __nr_t read_filesystem(struct stats_filesystem *st_filesystem, __nr_t nr_alloc)
  {
        FILE *fp;
-       char line[512], fs_name[128], mountp[256];
 -      char line[512], fs_name[128], mountp[256], type[128];
++      char line[512], fs_name[MAX_FS_LEN], mountp[256], type[128];
        int skip = 0, skip_next = 0;
--      char *pos = 0;
 -      __nr_t fs_read = 0, *pos2 = 0;
++      char *pos = 0, *pos2 = 0;
 +      __nr_t fs_read = 0;
        struct stats_filesystem *st_filesystem_i;
        struct statvfs buf;
  
                        if (pos == NULL)
                                continue;
  
 -                      /*      
++                      /*
+                        * Find second field separator position,
+                        * read filesystem type,
 -                       * if filesystem type is autofs, skip it 
++                       * if filesystem type is autofs, skip it
+                       */
+                       pos2 = strchr(pos + 1, ' ');
+                       if (pos2 == NULL)
+                               continue;
+                       sscanf(pos2 + 1, "%127s", type);
+                       if(strcmp(type, "autofs") == 0)
+                               continue;
                        /* Read current filesystem name */
                        sscanf(line, "%127s", fs_name);
                        /*