diff options
author | jkar8572 <jkar8572> | 2002-02-25 11:26:16 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2002-02-25 11:26:16 +0000 |
commit | 5d3392cbdbb422993125b5aa8a8de402fcbc4b04 (patch) | |
tree | 3ed3d0cbab3b3868003d8c8ba68ff7c4be7bbcd3 /quotasys.c | |
parent | 207d40e53c0ca06bf484b8975ba95f83656ad086 (diff) |
Fixed bug in warnquota option parsing (Michael Meskes)
Quota-tools now ignore automount mountpoints (Phillippe Troin)
Diffstat (limited to 'quotasys.c')
-rw-r--r-- | quotasys.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -16,6 +16,7 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/vfs.h> #include "pot.h" #include "bylabel.h" @@ -619,6 +620,7 @@ static int cache_mnt_table(void) FILE *mntf; struct mntent *mnt; struct stat st; + struct statfs fsstat; int allocated = 0, i = 0, flags; dev_t dev = 0; char mntpointbuf[PATH_MAX]; @@ -651,6 +653,17 @@ static int cache_mnt_table(void) free((char *)devname); continue; } + if (statfs(mntpointbuf, &fsstat) != 0) { + errstr(_("Can't statfs() %s: %s\n"), mntpointbuf, strerror(errno)); + free((char *)devname); + continue; + } + /* Do not scan quotas on "magic" automount points */ + if (fsstat.f_blocks == 0 && fsstat.f_bfree == 0 && fsstat.f_bavail == 0) { + free((char *)devname); + continue; + } + flags = 0; if (strcmp(mnt->mnt_type, MNTTYPE_NFS)) { if (stat(devname, &st) < 0) { /* Can't stat mounted device? */ |