hashmap: make gcc shut up on old glibcs that lack getauxval()

This commit is contained in:
Lennart Poettering 2013-12-10 19:52:16 +00:00
parent 14c1025934
commit 65a6df56f1

View file

@ -185,7 +185,6 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
bool b;
Hashmap *h;
size_t size;
void *auxv;
b = is_main_thread();
@ -222,8 +221,11 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
* rehash everything using a new random XOR mask from
* /dev/random. */
#ifdef HAVE_SYS_AUXV_H
auxv = (void*) getauxval(AT_RANDOM);
h->random_xor = auxv ? *(unsigned*) auxv : random_u();
{
void *auxv;
auxv = (void*) getauxval(AT_RANDOM);
h->random_xor = auxv ? *(unsigned*) auxv : random_u();
}
#else
h->random_xor = random_u();
#endif