diff options
author | Bruce Evans <bde@FreeBSD.org> | 1999-05-15 11:54:36 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1999-05-15 11:54:36 +0000 |
commit | 9d91b8ad50c1fa64858b344563e3c02e200ea55d (patch) | |
tree | 563d064c6d259beed3fa2bc96e72a0cc76260f3f /usr.sbin/kvm_mkdb | |
parent | 429d613afc52edc2edf0e86242ca279407d5280a (diff) | |
download | src-9d91b8ad50c1fa64858b344563e3c02e200ea55d.tar.gz src-9d91b8ad50c1fa64858b344563e3c02e200ea55d.zip |
Test the correct database file (not necessarily the one corresponding to
the running kernel if the nlist file is specified explicitly).
Notes
Notes:
svn path=/head/; revision=47218
Diffstat (limited to 'usr.sbin/kvm_mkdb')
-rw-r--r-- | usr.sbin/kvm_mkdb/extern.h | 3 | ||||
-rw-r--r-- | usr.sbin/kvm_mkdb/kvm_mkdb.c | 7 | ||||
-rw-r--r-- | usr.sbin/kvm_mkdb/testdb.c | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/kvm_mkdb/extern.h b/usr.sbin/kvm_mkdb/extern.h index 6d722682ad88..fbe8efa7093f 100644 --- a/usr.sbin/kvm_mkdb/extern.h +++ b/usr.sbin/kvm_mkdb/extern.h @@ -34,5 +34,4 @@ */ void create_knlist __P((char *, DB *)); -void error __P((char *)); -int testdb __P(()); +int testdb __P((char *)); diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c index 0284c55d41c0..cfec1769847b 100644 --- a/usr.sbin/kvm_mkdb/kvm_mkdb.c +++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)kvm_mkdb.c 8.3 (Berkeley) 5/4/95"; #endif static const char rcsid[] = - "$Id$"; + "$Id: kvm_mkdb.c,v 1.7 1997/09/24 06:44:09 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -92,12 +92,13 @@ main(argc, argv) if (argc > 1) usage(); + nlistpath = argc > 0 ? argv[0] : (char *)getbootfile(); + /* If the existing db file matches the currently running kernel, exit */ - if (testdb()) + if (testdb(nlistpath)) exit(0); #define basename(cp) ((p = rindex((cp), '/')) != NULL ? p + 1 : (cp)) - nlistpath = argc > 0 ? argv[0] : (char *)getbootfile(); nlistname = basename(nlistpath); (void)snprintf(dbtemp, sizeof(dbtemp), "%skvm_%s.tmp", diff --git a/usr.sbin/kvm_mkdb/testdb.c b/usr.sbin/kvm_mkdb/testdb.c index 8d769bdad1be..1a8726ae72dc 100644 --- a/usr.sbin/kvm_mkdb/testdb.c +++ b/usr.sbin/kvm_mkdb/testdb.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)testdb.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: testdb.c,v 1.3 1997/09/24 06:44:12 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -54,11 +54,12 @@ static const char rcsid[] = /* Return true if the db file is valid, else false */ int -testdb() +testdb(uf) + char *uf; { register DB *db; register int cc, kd, ret, dbversionlen; - register char *cp, *uf; + register char *cp; DBT rec; struct nlist nitem; char dbname[MAXPATHLEN], dbversion[_POSIX2_LINE_MAX]; @@ -70,7 +71,6 @@ testdb() if ((kd = open(_PATH_KMEM, O_RDONLY, 0)) < 0) goto close; - uf = (char *)getbootfile(); if ((cp = rindex(uf, '/')) != 0) uf = cp + 1; (void) snprintf(dbname, sizeof(dbname), "%skvm_%s.db", _PATH_VARDB, uf); |