From efe1d83dbbe8492f0077b2c354eb087e53e42cd7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 4 Aug 2001 18:17:30 +0000 Subject: [PATCH] Print an error message if database could not be opened. Volker (This used to be commit b4f06c3ecf8af60352bc9e3af9c35c00827faad2) --- source3/tdb/tdbtool.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c index 8c09c76df55..8b396ca5a2a 100644 --- a/source3/tdb/tdbtool.c +++ b/source3/tdb/tdbtool.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -111,6 +112,9 @@ static void create_tdb(void) if (tdb) tdb_close(tdb); tdb = tdb_open(tok, 0, TDB_CLEAR_IF_FIRST, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (!tdb) { + printf("Could not create %s: %s\n", tok, strerror(errno)); + } } static void open_tdb(void) @@ -122,6 +126,9 @@ static void open_tdb(void) } if (tdb) tdb_close(tdb); tdb = tdb_open(tok, 0, 0, O_RDWR, 0600); + if (!tdb) { + printf("Could not open %s: %s\n", tok, strerror(errno)); + } } static void insert_tdb(void)