summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2001-08-04 18:17:30 +0000
committerVolker Lendecke <vlendec@samba.org>2001-08-04 18:17:30 +0000
commitefe1d83dbbe8492f0077b2c354eb087e53e42cd7 (patch)
tree9db40cc76ff47c0b8a0898d0c7884cb2b90e5de2 /source3
parent27bdf594fbdb1d403c4810f8ae5d00dcb3999e9f (diff)
downloadsamba-efe1d83dbbe8492f0077b2c354eb087e53e42cd7.tar.gz
samba-efe1d83dbbe8492f0077b2c354eb087e53e42cd7.tar.bz2
samba-efe1d83dbbe8492f0077b2c354eb087e53e42cd7.zip
Print an error message if database could not be opened.
Volker (This used to be commit b4f06c3ecf8af60352bc9e3af9c35c00827faad2)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/tdbtool.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index 8c09c76df5..8b396ca5a2 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/tdb/tdbtool.c
@@ -1,3 +1,4 @@
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
@@ -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)