tdb_delete used as traversal function

Esh, Andrew AEsh at
Thu Jan 3 13:36:01 GMT 2002

Speaking from the standpoint of my C experience (I am not familiar with this
specific code):

Yes, the more obvious do_delete_fn function should be used.

The current code is correct, however. The extra arguments will only consume
some extra stack space, and will then be cleaned up when tdb_delete exits,
and the stack frame is popped off.

The current code will perform slightly better than do_delete_fn, however.

-----Original Message-----
From: andreas moroder [mailto:claudiamoroder at]
Sent: Thursday, January 03, 2002 3:19 PM
To: samba-technical at
Subject: tdb_delete used as traversal function


in the following files


tdb_delete is used as paramter to tdb_traverse

but tdb_delete has only two parameters 

int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key)

while tdb_traverse passes 4 of them

if (fn && fn(tdb, key, dbuf, state)) 

Should not 

static int do_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf,
                     void *state)
    return tdb_delete(the_tdb, key);

in tdb/tdbtool.c be used instead ? 



P.S. The comment before tdb_traverse is also wrong, it forgets the paramter 

-------------- next part --------------
HTML attachment scrubbed and removed

More information about the samba-technical mailing list