dbwrap_tool: Simplify dbwrap_tool_erase
authorVolker Lendecke <vl@samba.org>
Fri, 24 Aug 2018 12:39:19 +0000 (14:39 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 3 Sep 2018 16:44:23 +0000 (18:44 +0200)
That's what dbwrap_wipe is for :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/dbwrap_tool.c

index 94aacd8ba2665c6331551d207adca941ea504186..3ba0c52bb4ce2e4cc7ba40852a475185995476d6 100644 (file)
@@ -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;
        }