This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / usr.sbin / kvm_mkdb / kvm_mkdb.c
index ff6fa1c..7f7ca4e 100644 (file)
@@ -38,7 +38,8 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)kvm_mkdb.c 5.11 (Berkeley) 4/27/91";
+/*static char sccsid[] = "from: @(#)kvm_mkdb.c 5.11 (Berkeley) 4/27/91";*/
+static char rcsid[] = "$Id";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -71,14 +72,14 @@ main(argc, argv)
        argc -= optind;
        argv += optind;
 
        argc -= optind;
        argv += optind;
 
-       nlistpath = argc > 1 ? argv[0] : _PATH_UNIX;
+       nlistpath = argc > 0 ? argv[0] : _PATH_UNIX;
        nlistname = basename(nlistpath);
 
        (void)sprintf(dbtemp, "%s/kvm_%s.tmp", _PATH_VARRUN, nlistname);
        (void)sprintf(dbname, "%s/kvm_%s.db", _PATH_VARRUN, nlistname);
        (void)umask(0);
        nlistname = basename(nlistpath);
 
        (void)sprintf(dbtemp, "%s/kvm_%s.tmp", _PATH_VARRUN, nlistname);
        (void)sprintf(dbname, "%s/kvm_%s.db", _PATH_VARRUN, nlistname);
        (void)umask(0);
-       db = hash_open(dbtemp, O_CREAT|O_WRONLY|O_EXCL,
-           S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, NULL);
+       db = dbopen(dbtemp, O_CREAT|O_RDWR|O_EXCL,
+           S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, DB_HASH, NULL);
        if (!db) {
                (void)fprintf(stderr,
                    "kvm_mkdb: %s: %s\n", dbtemp, strerror(errno));
        if (!db) {
                (void)fprintf(stderr,
                    "kvm_mkdb: %s: %s\n", dbtemp, strerror(errno));