aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/db
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2010-04-05 10:12:21 +0000
committerAndriy Gapon <avg@FreeBSD.org>2010-04-05 10:12:21 +0000
commitf3c733e82bf4c5ac802817df6759b90fd9ee9698 (patch)
treeceb9c1c4ce36b3489dcdfaffe7b5c3cfa27f7322 /lib/libc/db
parent983419fe1eda12f3c39cc8316c4c085911b4f12e (diff)
Notes
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/hash/hash.c2
-rw-r--r--lib/libc/db/hash/hash.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 83d26577740f..638814ceb5d2 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -293,6 +293,8 @@ init_hash(HTAB *hashp, const char *file, const HASHINFO *info)
if (stat(file, &statbuf))
return (NULL);
hashp->BSIZE = statbuf.st_blksize;
+ if (hashp->BSIZE > MAX_BSIZE)
+ hashp->BSIZE = MAX_BSIZE;
hashp->BSHIFT = __log2(hashp->BSIZE);
}
diff --git a/lib/libc/db/hash/hash.h b/lib/libc/db/hash/hash.h
index 8329413fffea..cd11a3ae98eb 100644
--- a/lib/libc/db/hash/hash.h
+++ b/lib/libc/db/hash/hash.h
@@ -118,7 +118,7 @@ typedef struct htab { /* Memory resident data structure */
/*
* Constants
*/
-#define MAX_BSIZE 65536 /* 2^16 */
+#define MAX_BSIZE 32768 /* 2^15 but should be 65536 */
#define MIN_BUFFERS 6
#define MINHDRSIZE 512
#define DEF_BUFSIZE 65536 /* 64 K */