Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/kvm_mkdb Remove some unneccessary kmem open/close c...



details:   https://anonhg.NetBSD.org/src/rev/bc0d7240134d
branches:  trunk
changeset: 546611:bc0d7240134d
user:      ragge <ragge%NetBSD.org@localhost>
date:      Fri May 02 16:28:34 2003 +0000

description:
Remove some unneccessary kmem open/close code.

diffstat:

 usr.sbin/kvm_mkdb/testdb.c |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (48 lines):

diff -r a47e23a382ba -r bc0d7240134d usr.sbin/kvm_mkdb/testdb.c
--- a/usr.sbin/kvm_mkdb/testdb.c        Fri May 02 16:25:22 2003 +0000
+++ b/usr.sbin/kvm_mkdb/testdb.c        Fri May 02 16:28:34 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: testdb.c,v 1.8 2001/03/19 15:18:59 msaitoh Exp $       */
+/*     $NetBSD: testdb.c,v 1.9 2003/05/02 16:28:34 ragge Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)testdb.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: testdb.c,v 1.8 2001/03/19 15:18:59 msaitoh Exp $");
+__RCSID("$NetBSD: testdb.c,v 1.9 2003/05/02 16:28:34 ragge Exp $");
 #endif
 #endif /* not lint */
 
@@ -63,7 +63,7 @@
 testdb()
 {
        DB *db;
-       int kd, ret, dbversionlen;
+       int ret, dbversionlen;
        DBT rec;
        char dbversion[_POSIX2_LINE_MAX];
        char *kversion;
@@ -73,9 +73,6 @@
        ret = 0;
        db = NULL;
 
-       if ((kd = open(_PATH_KMEM, O_RDONLY, 0)) < 0)
-               goto close;
-
        if ((db = dbopen(_PATH_KVMDB, O_RDONLY, 0, DB_HASH, NULL)) == NULL)
                goto close;
 
@@ -104,9 +101,7 @@
        /* If they match, we win */
        ret = memcmp(dbversion, kversion, dbversionlen) == 0;
 
-close: if (kd >= 0)
-               (void)close(kd);
-       if (db)
+close: if (db)
                (void)(db->close)(db);
        return (ret);
 }



Home | Main Index | Thread Index | Old Index