summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-07-01 21:07:55 +0200
committerNoel Power <npower@samba.org>2019-07-03 10:51:32 +0000
commitfa2d5b3daa0eaae41e2c2348cb2a81adf9da3b62 (patch)
tree8ea112d31cc70cad76b991711814be334d2062cf /lib
parentf4430086fa2345c9ccf94644d92c08fd47f6a493 (diff)
downloadsamba-fa2d5b3daa0eaae41e2c2348cb2a81adf9da3b62.tar.gz
lib: Fix return of server_id_db_prune_name()
The tdb routines return 0/-1 and return the specific error via tdb_error(). server_id_db_prune_name() is expected to return an errno, not 0/-1. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Jul 3 10:51:32 UTC 2019 on sn-devel-184
Diffstat (limited to 'lib')
-rw-r--r--lib/util/server_id_db.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/util/server_id_db.c b/lib/util/server_id_db.c
index bb61f316d29..17b157706b4 100644
--- a/lib/util/server_id_db.c
+++ b/lib/util/server_id_db.c
@@ -184,7 +184,12 @@ int server_id_db_prune_name(struct server_id_db *db, const char *name,
tdb_chainunlock(tdb, key);
- return ret;
+ if (ret == -1) {
+ enum TDB_ERROR err = tdb_error(tdb);
+ return map_unix_error_from_tdb(err);
+ }
+
+ return 0;
}
int server_id_db_remove(struct server_id_db *db, const char *name)