diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-04-02 10:17:32 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-04-02 10:17:32 +1100 |
commit | 1bc9c3923574d548810733b512716d5758814328 (patch) | |
tree | aa128b82d3232a8c73de316aa5a7b8bd0caa9766 /lib | |
parent | 2fe17ae61e4f80b7c864bd6777c71557c97c0125 (diff) | |
parent | 36c1a52a57bc96c7586ca1bffbe8ef47c93bca1b (diff) | |
download | samba-1bc9c3923574d548810733b512716d5758814328.tar.gz samba-1bc9c3923574d548810733b512716d5758814328.tar.bz2 samba-1bc9c3923574d548810733b512716d5758814328.zip |
Merge commit 'master/master' into wspp-schema
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb/common/transaction.c | 1 | ||||
-rw-r--r-- | lib/tsocket/tsocket_bsd.c | 1 | ||||
-rw-r--r-- | lib/util/idtree.c | 8 |
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index 1cb7063a38..cb723ed134 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -864,7 +864,6 @@ static int transaction_setup_recovery(struct tdb_context *tdb, int tdb_transaction_prepare_commit(struct tdb_context *tdb) { const struct tdb_methods *methods; - int i; if (tdb->transaction == NULL) { TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_prepare_commit: no transaction\n")); diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c index 3d13dfd47d..8254f5d9d3 100644 --- a/lib/tsocket/tsocket_bsd.c +++ b/lib/tsocket/tsocket_bsd.c @@ -22,6 +22,7 @@ */ #include "replace.h" +#include "system/filesys.h" #include "system/network.h" #include "tsocket.h" #include "tsocket_internal.h" diff --git a/lib/util/idtree.c b/lib/util/idtree.c index c8a8b6346a..0af93a229d 100644 --- a/lib/util/idtree.c +++ b/lib/util/idtree.c @@ -372,12 +372,16 @@ _PUBLIC_ int idr_get_new_random(struct idr_context *idp, void *ptr, int limit) /* first try a random starting point in the whole range, and if that fails, then start randomly in the bottom half of the range. This can only - fail if the range is over half full */ + fail if the range is over half full, and finally fallback to any + free id */ id = idr_get_new_above(idp, ptr, 1+(generate_random() % limit), limit); if (id == -1) { id = idr_get_new_above(idp, ptr, 1+(generate_random()%(limit/2)), limit); } - + if (id == -1) { + id = idr_get_new_above(idp, ptr, 1, limit); + } + return id; } |