git » nmdb » commit 017c68e

nmdb: Fix minor build issues in the bdb and tc backends

author Alberto Bertogli
2010-04-20 17:48:21 UTC
committer Alberto Bertogli
2010-04-20 17:48:21 UTC
parent e54a300c3712418f55ce6c6da64ae79c92d87886

nmdb: Fix minor build issues in the bdb and tc backends

Commit 8578ddf (Support building with multiple backends, 2010-04-17)
introduced minor build issues in the bdb and tc backends, due to an
undetected problem during testing (they were not being built, even though
they should have been).

This patch fixes those issues, which are all minor typos or omissions.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

nmdb/be-bdb.c +2 -0
nmdb/be-tc.c +1 -1

diff --git a/nmdb/be-bdb.c b/nmdb/be-bdb.c
index 8233fd3..33a3f0f 100644
--- a/nmdb/be-bdb.c
+++ b/nmdb/be-bdb.c
@@ -3,6 +3,7 @@
 
 #include <string.h>	/* memset() */
 #include <stddef.h>	/* NULL */
+#include <stdlib.h>	/* malloc() and friends */
 
 /* typedefs to work around db.h include bug */
 typedef unsigned int u_int;
@@ -40,6 +41,7 @@ struct db_conn *bdb_open(const char *name, int flags)
 	if (db == NULL) {
 		bdb_db->close(bdb_db, 0);
 		return NULL;
+	}
 
 	db->conn = bdb_db;
 	db->set = bdb_set;
diff --git a/nmdb/be-tc.c b/nmdb/be-tc.c
index a035626..2b45057 100644
--- a/nmdb/be-tc.c
+++ b/nmdb/be-tc.c
@@ -20,7 +20,7 @@ struct db_conn *tc_open(const char *name, int flags)
 	struct db_conn *db;
 	TCHDB *tc_db = tchdbnew();
 
-	if (!tchdbopen(qdbm_db, name, HDBOWRITER | HDBOCREAT))
+	if (!tchdbopen(tc_db, name, HDBOWRITER | HDBOCREAT))
 		return NULL;
 
 	db = malloc(sizeof(struct db_conn));