From: Hallvard Furuseth Date: Wed, 27 Jul 2005 12:19:16 +0000 (+0000) Subject: bdb_locker_id, bdb_locker_id_free: BerkeleyDB lock ids are u_int32_t, not int. X-Git-Tag: OPENLDAP_AC_BP~176 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3226cdf2a33ce32c5d98fd81fa419cdd59dedc3a;p=openldap bdb_locker_id, bdb_locker_id_free: BerkeleyDB lock ids are u_int32_t, not int. --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index c898b7466c..d98ed21ecc 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -1318,15 +1318,15 @@ static void bdb_locker_id_free( void *key, void *data ) { DB_ENV *env = key; - int lockid = (int) data; + u_int32_t lockid = (u_int32_t) data; int rc; rc = XLOCK_ID_FREE( env, lockid ); if ( rc == EINVAL ) { DB_LOCKREQ lr; Debug( LDAP_DEBUG_ANY, - "bdb_locker_id_free: %d err %s(%d)\n", - lockid, db_strerror(rc), rc ); + "bdb_locker_id_free: %lu err %s(%d)\n", + (unsigned long) lockid, db_strerror(rc), rc ); /* release all locks held by this locker. */ lr.op = DB_LOCK_PUT_ALL; lr.obj = NULL; @@ -1336,9 +1336,10 @@ bdb_locker_id_free( void *key, void *data ) } int -bdb_locker_id( Operation *op, DB_ENV *env, int *locker ) +bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker ) { - int i, rc, lockid; + int i, rc; + u_int32_t lockid; void *data; void *ctx; @@ -1375,12 +1376,12 @@ bdb_locker_id( Operation *op, DB_ENV *env, int *locker ) return rc; } } else { - lockid = (int)data; + lockid = (u_int32_t) data; } *locker = lockid; return 0; } -#endif +#endif /* BDB_REUSE_LOCKERS */ void bdb_cache_delete_entry( diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index 8a627c017b..5955721f4e 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -522,7 +522,7 @@ int bdb_cache_entry_db_unlock( #ifdef BDB_REUSE_LOCKERS #define bdb_locker_id BDB_SYMBOL(locker_id) -int bdb_locker_id( Operation *op, DB_ENV *env, int *locker ); +int bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker ); #define LOCK_ID_FREE(env, locker) ((void)0) #define LOCK_ID(env, locker) bdb_locker_id(op, env, locker)