tdb_delete used as traversal function
AEsh at tricord.com
Thu Jan 3 13:36:01 GMT 2002
Speaking from the standpoint of my C experience (I am not familiar with this
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.
From: andreas moroder [mailto:claudiamoroder at st-ulrich.suedtirol.net]
Sent: Thursday, January 03, 2002 3:19 PM
To: samba-technical at lists.samba.org
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))
static int do_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf,
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