summaryrefslogtreecommitdiffstats
path: root/usr.sbin/quot
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-11-03 17:04:02 +0000
committerpeter <peter@FreeBSD.org>1995-11-03 17:04:02 +0000
commitc72327866cdc011dc3d23d7d839a1a296d84b9da (patch)
tree6a617d3ea855932a159afcd4728e063981e5c2ae /usr.sbin/quot
parent6d663f88f34768d48987728fc5242e7946e7fc3c (diff)
downloadFreeBSD-src-c72327866cdc011dc3d23d7d839a1a296d84b9da.zip
FreeBSD-src-c72327866cdc011dc3d23d7d839a1a296d84b9da.tar.gz
No need to go back quite _that_ far to the MOUNT_UFS constant when we have
a perfectly good getvfsbyname("ufs").. :-) Pointed out by: wollman and bde
Diffstat (limited to 'usr.sbin/quot')
-rw-r--r--usr.sbin/quot/quot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
index 4825d82..db2ece7 100644
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -30,7 +30,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: quot.c,v 1.1.1.1 1995/11/03 15:06:04 peter Exp $";
+static char rcsid[] = "$Id: quot.c,v 1.2 1995/11/03 15:21:04 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -525,6 +525,7 @@ int main(argc,argv)
char all = 0;
FILE *fp;
struct statfs *mp;
+ struct vfsconf vfc, *vfsp;
char dev[MNAMELEN + 1];
char *nm;
int cnt;
@@ -566,8 +567,13 @@ int main(argc,argv)
}
if (all) {
cnt = getmntinfo(&mp,MNT_NOWAIT);
+ vfsp = getvfsbyname("ufs");
+ if (vfsp == NULL) {
+ fprintf(stderr, "cannot find ufs/ffs filesystem type!\n");
+ exit(1);
+ }
for (; --cnt >= 0; mp++) {
- if (mp->f_type == MOUNT_UFS) {
+ if (mp->f_type == vfsp->vfc_index) {
if (nm = strrchr(mp->f_mntfromname,'/')) {
sprintf(dev,"/dev/r%s",nm + 1);
nm = dev;
OpenPOWER on IntegriCloud