From owner-freebsd-bugs Fri Aug 18 14:40: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 59DBA37B424 for ; Fri, 18 Aug 2000 14:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id OAA33421; Fri, 18 Aug 2000 14:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from guru.mired.org (zoom1-111.telepath.com [216.14.1.111]) by hub.freebsd.org (Postfix) with SMTP id 0FC2237B422 for ; Fri, 18 Aug 2000 14:33:38 -0700 (PDT) Received: (qmail 77723 invoked by uid 100); 18 Aug 2000 21:33:02 -0000 Message-Id: <20000818213302.77722.qmail@guru.mired.org> Date: 18 Aug 2000 21:33:02 -0000 From: mwm@mired.org Reply-To: mwm@mired.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/20710: mount output is to long, and "mount -v" is useless. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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