summaryrefslogtreecommitdiff
path: root/source3/tdb/tdbtest.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-12-04 07:40:25 +0000
committerMartin Pool <mbp@samba.org>2001-12-04 07:40:25 +0000
commit7d9e09f5279ee19a69a0f9e09fe3bb9eb51cc885 (patch)
tree487f92c99205a86c8fbff77c2b63e95e838a1ad4 /source3/tdb/tdbtest.c
parentc75ef67f9741d0acdd8b6be91b710fab6bd0b8e7 (diff)
downloadsamba-7d9e09f5279ee19a69a0f9e09fe3bb9eb51cc885.tar.gz
samba-7d9e09f5279ee19a69a0f9e09fe3bb9eb51cc885.tar.bz2
samba-7d9e09f5279ee19a69a0f9e09fe3bb9eb51cc885.zip
Better error handling:
- tdb_open api changed so that you now pass an error handling callback when opening the file, so that errors detected during opening have somewhere to go. (All calls from the body of Samba to this function go through a wrapper in tdbutil, which has been updated.) - Clean up logic for deciding how to open tdb. Emit log messages if something goes wrong (e.g. bad magic.) - tdbtool now logs errors to stderr. (This used to be commit 0aa800618eab1043d802c04fb1d125cd07936769)
Diffstat (limited to 'source3/tdb/tdbtest.c')
-rw-r--r--source3/tdb/tdbtest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/tdb/tdbtest.c b/source3/tdb/tdbtest.c
index cfc6135a0a..ca4ca54142 100644
--- a/source3/tdb/tdbtest.c
+++ b/source3/tdb/tdbtest.c
@@ -189,7 +189,6 @@ static int traverse_fn(TDB_CONTEXT *db, TDB_DATA key, TDB_DATA dbuf, void *state
static void merge_test()
{
- int klen, dlen;
int i;
char keys[5][2];
TDB_DATA key, data;
@@ -227,7 +226,8 @@ int main(int argc, char *argv[])
unlink("test.gdbm");
db = tdb_open("test.tdb", 0, TDB_CLEAR_IF_FIRST,
- O_RDWR | O_CREAT | O_TRUNC, 0600);
+ O_RDWR | O_CREAT | O_TRUNC, 0600,
+ tdb_log_to_stderr);
gdbm = gdbm_open("test.gdbm", 512, GDBM_WRITER|GDBM_NEWDB|GDBM_FAST,
0600, NULL);