From 6c3163cc9715188ee8087c6dbf63776f0dc9f1f5 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 4 Dec 2001 02:58:42 +0000 Subject: Set errno in tdb_open in cases where we detect an error in opening the database, but no underlying system call sets errno. The particular case I had was a mangled .tdb, but there are others. For this one, set EIO. It's a shame Unix messages aren't more detailed -- "bad data format" would be better. (This used to be commit 5630a988be05c21b60aba6304d4aaadce6024817) --- source3/tdb/README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/tdb/README') diff --git a/source3/tdb/README b/source3/tdb/README index fac3eacb4d..3715c685c2 100644 --- a/source3/tdb/README +++ b/source3/tdb/README @@ -60,7 +60,8 @@ TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags, The hash size is advisory, use zero for a default value. - return is NULL on error + Return is NULL on error, in which case errno is also set. Don't + try to call tdb_error or tdb_errname, just do strerror(errno). possible tdb_flags are: TDB_CLEAR_IF_FIRST - clear database if we are the only one with it open -- cgit