add micro HAVE_FILE_SYSTEM_ID check

pull/5/head
yuqing 2016-01-14 18:48:37 +08:00
parent e73b37f7da
commit 481f57befa
2 changed files with 8 additions and 2 deletions

View File

@ -138,7 +138,6 @@ int get_uptime(time_t *uptime)
left.f_bavail = right.f_bavail; \
left.f_files = right.f_files; \
left.f_ffree = right.f_ffree; \
left.f_fsid = right.f_fsid; \
} while (0)
#define SET_MNT_FIELDS(left, fstypename, mntfromname, mntonname) \
@ -192,6 +191,9 @@ int get_mounted_filesystems(struct fast_statfs *stats, const int size, int *coun
if (statfs(stats[i].f_mntonname, &buf) == 0)
{
SET_STATFS_FIELDS(stats[i], buf);
#ifdef HAVE_FILE_SYSTEM_ID
stats[i].f_fsid = buf.f_fsid;
#endif
}
else
{
@ -235,6 +237,9 @@ int get_mounted_filesystems(struct fast_statfs *stats, const int size, int *coun
for (i=0; i<*count; i++)
{
SET_STATFS_FIELDS(stats[i], mnts[i]);
#ifdef HAVE_FILE_SYSTEM_ID
stats[i].f_fsid = mnts[i].f_fsid;
#endif
SET_MNT_FIELDS(stats[i], mnts[i].f_fstypename,
mnts[i].f_mntfromname, mnts[i].f_mntonname);
}

View File

@ -39,8 +39,9 @@ extern "C" {
long f_bavail; /* free blocks avail to non-superuser */
long f_files; /* total file nodes in file system */
long f_ffree; /* free file nodes in fs */
#ifdef HAVE_FILE_SYSTEM_ID
fsid_t f_fsid; /* file system id */
#endif
char f_fstypename[MFSNAMELEN]; /* fs type name */
char f_mntfromname[MNAMELEN]; /* mounted file system */
char f_mntonname[MNAMELEN]; /* directory on which mounted */