misc: fix rehashing hashtable entries
authorDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 8 Aug 2012 13:13:49 +0000 (15:13 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 8 Aug 2012 13:13:49 +0000 (15:13 +0200)
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>
src/static_misc.c

index db49135..a6714e1 100644 (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,