{
struct connections_key key;
struct connections_data crec;
- TDB_DATA kbuf, dbuf, lockkey;
- BOOL rec_locked = False;
+ TDB_DATA kbuf, dbuf;
BOOL ret = True;
if (!tdb) {
cs.name = lp_servicename(SNUM(conn));
cs.Clear = Clear;
- lockkey.dptr = cs.name;
- lockkey.dsize = strlen(cs.name)+1;
-
- /*
- * Go through and count the connections with hash chain representing the service name
- * locked. This is slow but removes race conditions. JRA.
- */
-
- if (tdb_chainlock(tdb, lockkey)) {
- DEBUG(0,("claim_connection: tdb_chainlock failed %s\n",
- tdb_errorstr(tdb) ));
- return False;
- }
-
- rec_locked = True;
-
if (tdb_traverse(tdb, count_fn, &cs) == -1) {
DEBUG(0,("claim_connection: traverse of connections.tdb failed with error %s.\n",
tdb_errorstr(tdb) ));
out:
- if (rec_locked)
- tdb_chainunlock(tdb, lockkey);
-
return ret;
}