From f1b2407b0bf95d5b3a8754490f2ac2499319b52a Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 16 Mar 1995 18:37:47 +0000 Subject: [PATCH] Print out flags as text rather than a number. --- usr.bin/lsvfs/lsvfs.1 | 8 +++++--- usr.bin/lsvfs/lsvfs.c | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/usr.bin/lsvfs/lsvfs.1 b/usr.bin/lsvfs/lsvfs.1 index 03a113932a7f..35ac03b8db7a 100644 --- a/usr.bin/lsvfs/lsvfs.1 +++ b/usr.bin/lsvfs/lsvfs.1 @@ -1,8 +1,8 @@ -.\" $Id$ +.\" $Id: lsvfs.1,v 1.1 1994/09/22 01:25:56 wollman Exp $ .\" Garrett A. Wollman, September 1994 .\" This file is in the public domain. .\" -.Dd September 21, 1994 +.Dd March 16, 1995 .Dt LSVFS 1 .Os .Sh NAME @@ -40,7 +40,9 @@ parameter to the number of references to this VFS; i.e., the number of currently mounted filesystems of this type .It Flags -flag bits (none are currently defined). +flag bits (only +.Dq static +is currently defined). .El .Sh SEE ALSO .Xr mount 2 , diff --git a/usr.bin/lsvfs/lsvfs.c b/usr.bin/lsvfs/lsvfs.c index db33bfbf7f22..7ac562acc044 100644 --- a/usr.bin/lsvfs/lsvfs.c +++ b/usr.bin/lsvfs/lsvfs.c @@ -2,6 +2,8 @@ * lsvfs - lsit loaded VFSes * Garrett A. Wollman, September 1994 * This file is in the public domain. + * + * $Id$ */ #include @@ -10,9 +12,11 @@ #include #include -#define FMT "%-32.32s %5d %5d %5d\n" -#define HDRFMT "%-32.32s %5.5s %5.5s %5.5s\n" -#define DASHES "-------------------------------- ----- ----- -----\n" +#define FMT "%-32.32s %5d %5d %s\n" +#define HDRFMT "%-32.32s %5.5s %5.5s %s\n" +#define DASHES "-------------------------------- ----- ----- ---------------\n" + +static const char *fmt_flags(int); int main(int argc, char **argv) @@ -31,7 +35,7 @@ main(int argc, char **argv) vfc = getvfsbyname(*argv); if(vfc) { printf(FMT, vfc->vfc_name, vfc->vfc_index, vfc->vfc_refcount, - vfc->vfc_flags); + fmt_flags(vfc->vfc_flags)); } else { warnx("VFS %s unknown or not loaded", *argv); rv++; @@ -48,3 +52,9 @@ main(int argc, char **argv) return rv; } +static const char * +fmt_flags(int flags) +{ + return (flags & VFCF_STATIC) ? "static" : ""; +} +