1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Print an error message if database could not be opened.

Volker
(This used to be commit b4f06c3ecf)
This commit is contained in:
Volker Lendecke 2001-08-04 18:17:30 +00:00
parent 27bdf594fb
commit efe1d83dbb

View File

@ -1,3 +1,4 @@
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
@ -111,6 +112,9 @@ static void create_tdb(void)
if (tdb) tdb_close(tdb); if (tdb) tdb_close(tdb);
tdb = tdb_open(tok, 0, TDB_CLEAR_IF_FIRST, tdb = tdb_open(tok, 0, TDB_CLEAR_IF_FIRST,
O_RDWR | O_CREAT | O_TRUNC, 0600); O_RDWR | O_CREAT | O_TRUNC, 0600);
if (!tdb) {
printf("Could not create %s: %s\n", tok, strerror(errno));
}
} }
static void open_tdb(void) static void open_tdb(void)
@ -122,6 +126,9 @@ static void open_tdb(void)
} }
if (tdb) tdb_close(tdb); if (tdb) tdb_close(tdb);
tdb = tdb_open(tok, 0, 0, O_RDWR, 0600); 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) static void insert_tdb(void)