summaryrefslogtreecommitdiff
path: root/src/basic/random-util.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-04-23 15:53:29 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-04-24 01:31:05 +0900
commitd5a99b7c9c65ab7651c51de4db81d34cfd51f143 (patch)
tree3c6a5d69adbae595793833bc8f29bd7f66501317 /src/basic/random-util.c
parent5662811e34a4c553ec4c5684d66061192427a1b3 (diff)
downloadsystemd-d5a99b7c9c65ab7651c51de4db81d34cfd51f143.tar.gz
tree-wide: Simplify variable declarations behind #ifdef
Diffstat (limited to 'src/basic/random-util.c')
-rw-r--r--src/basic/random-util.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/basic/random-util.c b/src/basic/random-util.c
index f2e68fcddd..a9fe25432c 100644
--- a/src/basic/random-util.c
+++ b/src/basic/random-util.c
@@ -100,9 +100,7 @@ static void clear_srand_initialization(void) {
void initialize_srand(void) {
static bool pthread_atfork_registered = false;
unsigned x;
-#if HAVE_SYS_AUXV_H
- const void *auxv;
-#endif
+
if (srand_called)
return;
@@ -113,7 +111,7 @@ void initialize_srand(void) {
* AT_RANDOM data might be used by other stuff too (in particular: ASLR), and we probably shouldn't
* leak the seed for that. */
- auxv = ULONG_TO_PTR(getauxval(AT_RANDOM));
+ const void *auxv = ULONG_TO_PTR(getauxval(AT_RANDOM));
if (auxv) {
static const uint8_t auxval_hash_key[16] = {
0x92, 0x6e, 0xfe, 0x1b, 0xcf, 0x00, 0x52, 0x9c, 0xcc, 0x42, 0xcf, 0xdc, 0x94, 0x1f, 0x81, 0x0f