summaryrefslogtreecommitdiffstats
path: root/usr.sbin/kvm_mkdb/kvm_mkdb.c
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>1999-04-18 17:11:10 +0000
committerespie <espie@openbsd.org>1999-04-18 17:11:10 +0000
commit9da998eef43c756ea4640b26681ded7daed46284 (patch)
tree79ba90dcd0109b09191cf2bb58ef00c2bfe010b9 /usr.sbin/kvm_mkdb/kvm_mkdb.c
parento Opening a zero-length hash file should not be an error (diff)
downloadwireguard-openbsd-9da998eef43c756ea4640b26681ded7daed46284.tar.xz
wireguard-openbsd-9da998eef43c756ea4640b26681ded7daed46284.zip
Document -v
Give more precise error messages in case of failure
Diffstat (limited to 'usr.sbin/kvm_mkdb/kvm_mkdb.c')
-rw-r--r--usr.sbin/kvm_mkdb/kvm_mkdb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c
index 6f4ae34965f..33de5885c49 100644
--- a/usr.sbin/kvm_mkdb/kvm_mkdb.c
+++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_mkdb.c,v 1.9 1999/03/29 20:42:50 millert Exp $ */
+/* $OpenBSD: kvm_mkdb.c,v 1.10 1999/04/18 17:11:11 espie Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "from: @(#)kvm_mkdb.c 8.3 (Berkeley) 5/4/95";
#else
-static char *rcsid = "$OpenBSD: kvm_mkdb.c,v 1.9 1999/03/29 20:42:50 millert Exp $";
+static char *rcsid = "$OpenBSD: kvm_mkdb.c,v 1.10 1999/04/18 17:11:11 espie Exp $";
#endif
#endif /* not lint */
@@ -100,7 +100,6 @@ main(argc, argv)
case 'v':
verbose = 1;
break;
- case '?':
default:
usage();
}
@@ -121,9 +120,10 @@ main(argc, argv)
nlistname = basename(_PATH_UNIX);
if ((fd = open((nlistpath = _PATH_KSYMS), O_RDONLY, 0)) == -1 ||
(rval = kvm_mkdb(fd, nlistpath, nlistname, verbose)) != 0) {
- if (fd != -1)
- warnx("will try again using %s instead",
- _PATH_UNIX);
+ if (fd == -1)
+ warnx("can't open %s", _PATH_KSYMS);
+ else
+ warnx("will try again using %s instead", _PATH_UNIX);
if ((fd = open((nlistpath = _PATH_UNIX), O_RDONLY, 0)) == -1)
err(1, "can't open %s", nlistpath);
rval = kvm_mkdb(fd, nlistpath, nlistname, verbose);
@@ -184,6 +184,6 @@ kvm_mkdb(fd, nlistpath, nlistname, verbose)
void
usage()
{
- (void)fprintf(stderr, "usage: kvm_mkdb [file]\n");
+ (void)fprintf(stderr, "usage: kvm_mkdb [-v] [file]\n");
exit(1);
}