misc: fix rehashing hashtable entries

We need to hash the key instead of the whole entry, otherwise, we have
dead/wrong entries in the hash-table after a rehash-round.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-08-08 15:13:49 +02:00
parent 2e06e93a80
commit f880a3abdb

View File

@ -305,8 +305,9 @@ bool kmscon_direct_equal(const void *data1, const void *data2)
static size_t rehash(const void *ele, void *priv)
{
struct kmscon_hashtable *tbl = priv;
const struct kmscon_hashentry *ent = ele;
return tbl->hash_cb(ele);
return tbl->hash_cb(ent->key);
}
int kmscon_hashtable_new(struct kmscon_hashtable **out,