1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

tdb_traverse returns number of records, not zero, on success.

Now tested max connections and it works again. Hurrah !
Jeremy.
(This used to be commit 6565b8c978)
This commit is contained in:
Jeremy Allison 2001-05-14 18:43:49 +00:00
parent 1b1aaa9dbe
commit de6b5d8fb2

View File

@ -91,7 +91,7 @@ static int count_fn( TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *u
return 0;
}
if (strequal(crec.name, cs->name))
if (cs && strequal(crec.name, cs->name))
cs->curr_connections++;
return 0;
@ -137,7 +137,8 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
db_locked = True;
if (tdb_traverse(tdb, count_fn, &cs)) {
if (tdb_traverse(tdb, count_fn, &cs) == -1) {
DEBUG(0,("claim_connection: traverse of connections.tdb failed.\n"));
ret = False;
goto out;
}
@ -191,3 +192,14 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
return ret;
}
#if 0
/****************************************************************************
Use the count function to clean any dead records. Shouldn't be needed...
****************************************************************************/
void clean_connection_db(void)
{
if (tdb_traverse(tdb, count_fn, NULL) == -1)
DEBUG(0,("clean_connection_db: traverse of connections.tdb failed.\n"));
}
#endif