summaryrefslogtreecommitdiffabout
path: root/src
Side-by-side diff
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gdbmtool.c15
-rw-r--r--src/var.c2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
index e99547d..5ae668c 100644
--- a/src/gdbmtool.c
+++ b/src/gdbmtool.c
@@ -87,7 +87,7 @@ opendb (char *dbname)
flags |= GDBM_NOMMAP;
if (variable_is_true ("sync"))
flags |= GDBM_SYNC;
-
+
if (open_mode == GDBM_NEWDB)
{
if (interactive () && variable_is_true ("confirm") &&
@@ -114,6 +114,19 @@ opendb (char *dbname)
gdbm_setopt (db, GDBM_CACHESIZE, &cache_size, sizeof (int)) == -1)
terror (_("gdbm_setopt failed: %s"), gdbm_strerror (gdbm_errno));
+ if (variable_is_true ("coalesce"))
+ {
+ int t = 1;
+ if (gdbm_setopt (db, GDBM_SETCOALESCEBLKS, &t, sizeof (t)) == -1)
+ terror (_("gdbm_setopt failed: %s"), gdbm_strerror (gdbm_errno));
+ }
+ if (variable_is_true ("centfree"))
+ {
+ int t = 1;
+ if (gdbm_setopt (db, GDBM_SETCENTFREE, &t, sizeof (t)) == -1)
+ terror (_("gdbm_setopt failed: %s"), gdbm_strerror (gdbm_errno));
+ }
+
if (gdbm_file)
gdbm_close (gdbm_file);
diff --git a/src/var.c b/src/var.c
index be274c6..4765bc9 100644
--- a/src/var.c
+++ b/src/var.c
@@ -59,6 +59,8 @@ static struct variable vartab[] = {
{ "lock", VART_BOOL, VARF_INIT, { .bool = 1 } },
{ "mmap", VART_BOOL, VARF_INIT, { .bool = 1 } },
{ "sync", VART_BOOL, VARF_INIT, { .bool = 0 } },
+ { "coalesce", VART_BOOL, VARF_INIT, { .bool = 0 } },
+ { "centfree", VART_BOOL, VARF_INIT, { .bool = 0 } },
{ "filemode", VART_INT, VARF_INIT|VARF_OCTAL|VARF_PROT, { .num = 0644 } },
{ "pager", VART_STRING, VARF_DFL },
{ "quiet", VART_BOOL, VARF_DFL },

Return to:

Send suggestions and report system problems to the System administrator.