diff options
author | Luke Leighton <lkcl@samba.org> | 2000-02-04 04:59:31 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-02-04 04:59:31 +0000 |
commit | 49d7f0afbc1c5425d53019e234d54ddf205c8e9a (patch) | |
tree | 43d8357f41553776790830223ff831cb29e7a55a /source/locking/locking.c | |
parent | 176c405d2702a4245561ff56c8eac3c754a0dea3 (diff) | |
download | samba-49d7f0afbc1c5425d53019e234d54ddf205c8e9a.tar.gz samba-49d7f0afbc1c5425d53019e234d54ddf205c8e9a.tar.xz samba-49d7f0afbc1c5425d53019e234d54ddf205c8e9a.zip |
1) added void* state argument to tdb_traverse. guess what! there were
two places i found where it was appropriate to _use_ that third argument,
in locking.c and brlock.c! there was a static traverse_function and
i removed the static variable, typecast it to a void*, passed it to
tdb_traverse and re-cast it back to the traverse_function inside the
tdb_traverse function. this makes the use of tdb_traverse() reentrant,
which is never going to happen, i know, i just don't like to see
statics lying about when there's no need for them.
as i had to do in samba-tng, all uses of tdb_traverse modified to take
the new void* state argument.
2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient.
i don't know how the other samba team members would react if i deleted
rpcclient from cvs main. damn, that code's so old, it's unreal.
20 rpcclient commands, instead of about 70 in SAMBA_TNG.
Diffstat (limited to 'source/locking/locking.c')
-rw-r--r-- | source/locking/locking.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/locking/locking.c b/source/locking/locking.c index 9753b5ea615..890214f10e6 100644 --- a/source/locking/locking.c +++ b/source/locking/locking.c @@ -465,19 +465,20 @@ BOOL modify_share_mode(files_struct *fsp, int new_mode, uint16 new_oplock) return mod_share_mode(fsp, modify_share_mode_fn, (void *)&mv); } -static void (*traverse_callback)(share_mode_entry *, char *); /**************************************************************************** traverse the whole database with this function, calling traverse_callback on each share mode ****************************************************************************/ -static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf) +static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void* state) { struct locking_data *data; share_mode_entry *shares; char *name; int i; + SHAREMODE_FN(traverse_callback) = (SHAREMODE_FN_CAST())state; + data = (struct locking_data *)dbuf.dptr; shares = (share_mode_entry *)(dbuf.dptr + sizeof(*data)); name = dbuf.dptr + sizeof(*data) + data->num_share_mode_entries*sizeof(*shares); @@ -492,9 +493,8 @@ static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf) Call the specified function on each entry under management by the share mode system. ********************************************************************/ -int share_mode_forall(void (*fn)(share_mode_entry *, char *)) +int share_mode_forall(SHAREMODE_FN(fn)) { if (!tdb) return 0; - traverse_callback = fn; - return tdb_traverse(tdb, traverse_fn); + return tdb_traverse(tdb, traverse_fn, (void*)fn); } |