Skip site navigation (1)Skip section navigation (2)
Date:      18 Aug 2000 21:33:02 -0000
From:      mwm@mired.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/20710: mount output is to long, and "mount -v" is useless.
Message-ID:  <20000818213302.77722.qmail@guru.mired.org>

next in thread | raw e-mail | index | archive | help

>Number:         20710
>Category:       bin
>Synopsis:       mount output is to long, and "mount -v" is useless.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 18 14:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mike Meyer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Missionaria Phonibalonica
>Environment:

	Most recent version of FreeBSD.

>Description:

	The "mount" command to get a list of mounted file systems now
	outputs lots of information, making the critical stuff - the
	actual mount points - hard to find.
	
	Also, the command "mount -v" and the command "mount" do the
	exact same thing. This seems like such a waste.

>How-To-Repeat:

	Run "mount" and notice the wrapped lines on an 80-column screen.
	Run "mount -v" and notice nearly identical output!

>Fix:

	The attached patch to sbin/mount/mount.c changes mount so that
	a bare "mount" just lists the mount points, and "mount -v"
	prints all the statistics.
	
	While it might be desirable to have "mount" print the options as well,
	having the non-verbose one be as quiet as possible while still
	being useful seemed like the right option.


--- mount.c-orig	Fri Aug 18 16:20:39 2000
+++ mount.c	Fri Aug 18 16:22:23 2000
@@ -81,7 +81,7 @@
 int	mountfs __P((const char *, const char *, const char *,
 			int, const char *, const char *));
 void	remopt __P((char *, const char *));
-void	prmount __P((struct statfs *));
+void	prmount __P((struct statfs *, int verbose));
 void	putfsent __P((const struct statfs *));
 void	usage __P((void));
 char   *flags2opts __P((int));
@@ -219,7 +219,7 @@
 				if (checkvfsname(mntbuf[i].f_fstypename,
 				    vfslist))
 					continue;
-				prmount(&mntbuf[i]);
+				prmount(&mntbuf[i], verbose);
 			}
 		}
 		exit(rval);
@@ -490,7 +490,7 @@
 			if (fstab_style)
 				putfsent(&sf);
 			else
-				prmount(&sf);
+				prmount(&sf, 1);
 		}
 		break;
 	}
@@ -499,15 +499,20 @@
 }
 
 void
-prmount(sfp)
+prmount(sfp, verbose)
 	struct statfs *sfp;
+	int verbose;
 {
 	int flags;
 	struct opt *o;
 	struct passwd *pw;
 
-	(void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname,
-	    sfp->f_fstypename);
+	(void)printf("%s on %s", sfp->f_mntfromname, sfp->f_mntonname);
+	if (!verbose) {
+	  putchar('\n');
+	  return;
+	}
+	(void)printf(" (%s", sfp->f_fstypename);
 
 	flags = sfp->f_flags & MNT_VISFLAGMASK;
 	for (o = optnames; flags && o->o_opt; o++)



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000818213302.77722.qmail>