diff options
author | bde <bde@FreeBSD.org> | 1999-05-15 11:54:36 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-05-15 11:54:36 +0000 |
commit | f1c57e949bd50b178bb720ba816780275cda469e (patch) | |
tree | 71db8c0813486b74f545dc31e90466b89a605d9e /usr.sbin/kvm_mkdb | |
parent | 13644a2bd23564234eed6c8a010a1ececb34d48a (diff) | |
download | FreeBSD-src-f1c57e949bd50b178bb720ba816780275cda469e.zip FreeBSD-src-f1c57e949bd50b178bb720ba816780275cda469e.tar.gz |
Test the correct database file (not necessarily the one corresponding to
the running kernel if the nlist file is specified explicitly).
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 6d72268..fbe8efa 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 0284c55..cfec176 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 8d769bd..1a8726a 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); |