From: Volker Lendecke Date: Fri, 24 Aug 2018 12:39:19 +0000 (+0200) Subject: dbwrap_tool: Simplify dbwrap_tool_erase X-Git-Tag: tdb-1.3.17~1887 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89f9c163f32a409a40ae73455af892e58cd0e214;p=thirdparty%2Fsamba.git dbwrap_tool: Simplify dbwrap_tool_erase That's what dbwrap_wipe is for :-) Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c index 94aacd8ba26..3ba0c52bb4c 100644 --- a/source3/utils/dbwrap_tool.c +++ b/source3/utils/dbwrap_tool.c @@ -280,13 +280,6 @@ static int dbwrap_tool_exists(struct db_context *db, return (result)?0:1; } - -static int delete_fn(struct db_record *rec, void *priv) -{ - dbwrap_record_delete(rec); - return 0; -} - /** * dbwrap_tool_erase: erase the whole data base * the keyname argument is not used. @@ -295,11 +288,11 @@ static int dbwrap_tool_erase(struct db_context *db, const char *keyname, const char *data) { - NTSTATUS status; + int ret; - status = dbwrap_traverse(db, delete_fn, NULL, NULL); + ret = dbwrap_wipe(db); - if (!NT_STATUS_IS_OK(status)) { + if (ret != 0) { d_fprintf(stderr, "ERROR erasing the database\n"); return -1; }