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);
__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);
/*