diff options
author | wollman <wollman@FreeBSD.org> | 1995-03-16 20:29:11 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-03-16 20:29:11 +0000 |
commit | b2dad10ffa929eb0224d6092c436939ae67f8e27 (patch) | |
tree | ccfd381c0c51692905fdc5971c92cd2000a007ec | |
parent | 8e37e9f4798af7aceac629635492aaa37a2abdad (diff) | |
download | FreeBSD-src-b2dad10ffa929eb0224d6092c436939ae67f8e27.zip FreeBSD-src-b2dad10ffa929eb0224d6092c436939ae67f8e27.tar.gz |
Print out the new flags.
-rw-r--r-- | usr.bin/lsvfs/lsvfs.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/usr.bin/lsvfs/lsvfs.c b/usr.bin/lsvfs/lsvfs.c index 7ac562a..aa2fb0c 100644 --- a/usr.bin/lsvfs/lsvfs.c +++ b/usr.bin/lsvfs/lsvfs.c @@ -3,7 +3,7 @@ * Garrett A. Wollman, September 1994 * This file is in the public domain. * - * $Id$ + * $Id: lsvfs.c,v 1.3 1995/03/16 18:37:47 wollman Exp $ */ #include <sys/types.h> @@ -55,6 +55,39 @@ main(int argc, char **argv) static const char * fmt_flags(int flags) { - return (flags & VFCF_STATIC) ? "static" : ""; + /* + * NB: if you add new flags, don't forget to add them here vvvvvv too. + */ + static char buf[sizeof "static, network, read-only, synthetic, loopback"]; + int comma = 0; + + buf[0] = '\0'; + + if(flags & VFCF_STATIC) { + if(comma++) strcat(buf, ", "); + strcat(buf, "static"); + } + + if(flags & VFCF_NETWORK) { + if(comma++) strcat(buf, ", "); + strcat(buf, "network"); + } + + if(flags & VFCF_READONLY) { + if(comma++) strcat(buf, ", "); + strcat(buf, "read-only"); + } + + if(flags & VFCF_SYNTHETIC) { + if(comma++) strcat(buf, ", "); + strcat(buf, "synthetic"); + } + + if(flags & VFCF_LOOPBACK) { + if(comma++) strcat(buf, ", "); + strcat(buf, "loopback"); + } + + return buf; } |