From: Keith Bostic Date: Sun, 24 Jan 1993 02:32:20 +0000 (-0800) Subject: don't be so noisy... X-Git-Tag: BSD-4_4-Snapshot-Development~3541 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/188c396b386f362de4cdbe3e6f4db5d461cd8a00?ds=inline don't be so noisy... SCCS-vsn: usr.bin/cap_mkdb/cap_mkdb.c 5.2 --- diff --git a/usr/src/usr.bin/cap_mkdb/cap_mkdb.c b/usr/src/usr.bin/cap_mkdb/cap_mkdb.c index 6038ee218a..7f22362b81 100644 --- a/usr/src/usr.bin/cap_mkdb/cap_mkdb.c +++ b/usr/src/usr.bin/cap_mkdb/cap_mkdb.c @@ -12,7 +12,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)cap_mkdb.c 5.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)cap_mkdb.c 5.2 (Berkeley) %G%"; #endif /* not lint */ #include @@ -32,7 +32,7 @@ static void err __P((int, const char *, ...)); static void getnamefield __P((char **, char *)); static void usage __P((void)); -int docapdbunlink, printnl; +int docapdbunlink, printnl, verbose; char *capdb, **inputfiles; /* @@ -51,11 +51,14 @@ main(argc, argv) char *outname, buf[MAXPATHLEN + 1], **f; outname = NULL; - while ((c = getopt(argc, argv, "f:")) != EOF) { + while ((c = getopt(argc, argv, "f:v")) != EOF) { switch(c) { case 'f': outname = optarg; break; + case 'v': + verbose = 1; + break; case '?': default: usage(); @@ -85,11 +88,11 @@ main(argc, argv) */ for (f = inputfiles; *f != NULL; f++) { (void)sprintf(buf, "%s.db", *f); - fd = open(buf, O_RDONLY, 0444); + fd = open(buf, O_RDONLY, 0); if (fd == -1 && errno != ENOENT) err(1, "%s: %s", buf, strerror(errno)); if (fd >= 0) { - err(0, "Warning -- %s.db will override %s.", *f, *f); + err(0, "%s.db overrides %s.", *f, *f); (void)close(fd); } } @@ -191,7 +194,8 @@ db_build(inputfiles) free(nf); free(bp); - (void)printf("cap_mkdb: %d capability records\n", reccnt); + if (verbose) + (void)printf("cap_mkdb: %d capability records\n", reccnt); } void