From 580fedc321d0a7a11454ad633736101050ef13df Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:34 +0930 Subject: tdb_compat: respect TDB_NO_FSYNC environment variable for tdb2. I don't think this kind of hack belongs in the tdb2 source, but SAMBA uses it to speed testing, so we should respect it: handle it in our compat open wrapper. Signed-off-by: Rusty Russell Autobuild-User: Rusty Russell Autobuild-Date: Mon Jun 20 12:32:08 CEST 2011 on sn-devel-104 --- lib/tdb_compat/tdb_compat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/tdb_compat/tdb_compat.c b/lib/tdb_compat/tdb_compat.c index f432296a40..a9173fc33d 100644 --- a/lib/tdb_compat/tdb_compat.c +++ b/lib/tdb_compat/tdb_compat.c @@ -90,6 +90,12 @@ tdb_open_compat_(const char *name, int hash_size_unused, attr = &cif; tdb_flags &= ~TDB_CLEAR_IF_FIRST; } + + /* Testsuite uses this to speed things up. */ + if (getenv("TDB_NO_FSYNC")) { + tdb_flags |= TDB_NOSYNC; + } + return tdb_open(name, tdb_flags|TDB_ALLOW_NESTING, open_flags, mode, attr); } -- cgit