summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-03 18:07:52 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-10-03 18:07:52 +0000
commit6529ecd87e6b9acd802319ac8cc214567f5cdbac (patch)
tree4a0288ae6f641d02148ded912ba6b36b281e6242 /usr.sbin
parent033cd8fbddbfdfcd132ad14a40be589fb096f993 (diff)
set bsize for hash to some reasonable value instead of
defaulting to the underlying fs block size. add rcsid tag. millert@ ok.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dev_mkdb/dev_mkdb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/dev_mkdb/dev_mkdb.c b/usr.sbin/dev_mkdb/dev_mkdb.c
index e198e759377..18469377ec9 100644
--- a/usr.sbin/dev_mkdb/dev_mkdb.c
+++ b/usr.sbin/dev_mkdb/dev_mkdb.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: dev_mkdb.c,v 1.5 2000/10/03 18:07:51 mickey Exp $ */
+
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -39,7 +41,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)dev_mkdb.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$Id: dev_mkdb.c,v 1.4 1999/12/05 22:06:00 deraadt Exp $";
+static char rcsid[] = "$Id: dev_mkdb.c,v 1.5 2000/10/03 18:07:51 mickey Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -74,6 +76,7 @@ main(argc, argv)
} bkey;
DB *db;
DBT data, key;
+ HASHINFO info;
int ch;
u_char buf[MAXNAMLEN + 1];
char dbtmp[MAXPATHLEN], dbname[MAXPATHLEN];
@@ -97,8 +100,10 @@ main(argc, argv)
(void)snprintf(dbtmp, sizeof(dbtmp), "%sdev.tmp", _PATH_VARRUN);
(void)snprintf(dbname, sizeof(dbtmp), "%sdev.db", _PATH_VARRUN);
+ bzero(&info, sizeof(info));
+ info.bsize = 8192;
db = dbopen(dbtmp, O_CREAT|O_EXLOCK|O_RDWR|O_TRUNC,
- S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, DB_HASH, NULL);
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, DB_HASH, &info);
if (db == NULL)
err(1, "%s", dbtmp);
@@ -140,7 +145,8 @@ main(argc, argv)
(void)(db->close)(db);
if (rename(dbtmp, dbname))
err(1, "rename %s to %s", dbtmp, dbname);
- exit(0);
+
+ return (0);
}
void