From dd1d57370d6d83473a7ada3ceb8d250d357ff429 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 30 Jan 2012 10:06:55 +1030 Subject: tdb_compat: only use hashsize attribute when O_CREAT tdb2 complains if you specify a tdb1 hashsize, and you're not actually trying to create a new database. Signed-off-by: Rusty Russell --- lib/tdb_compat/tdb_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tdb_compat') diff --git a/lib/tdb_compat/tdb_compat.c b/lib/tdb_compat/tdb_compat.c index b37e6cc7ba..0406eff55e 100644 --- a/lib/tdb_compat/tdb_compat.c +++ b/lib/tdb_compat/tdb_compat.c @@ -136,7 +136,7 @@ tdb_open_compat_(const char *name, int hash_size, tdb_flags &= ~TDB_VOLATILE; } - if (hash_size && (tdb_flags & TDB_VERSION1)) { + if (hash_size && (tdb_flags & TDB_VERSION1) && (open_flags & O_CREAT)) { hsize.base.attr = TDB_ATTRIBUTE_TDB1_HASHSIZE; hsize.base.next = attr; hsize.tdb1_hashsize.hsize = hash_size; -- cgit