summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2023-04-22 11:59:04 +0200
committerSimon Horman <horms@kernel.org>2023-12-02 12:42:17 +0000
commit74dfaefd631694d771a38ede308da2083eae3a3b (patch)
tree75bfff2725956be8b60a9b323b7c69c781d237f3
parent22dcf5cb940a1f1174d601ad7dacf16b91ca6b44 (diff)
downloadkexec-tools-74dfaefd631694d771a38ede308da2083eae3a3b.tar.gz
m68k: fix getrandom() use with uclibc
With uclibc, getrandom() is only defined with _GNU_SOURCE, fix that: kexec/arch/m68k/bootinfo.c: In function 'bootinfo_add_rng_seed': kexec/arch/m68k/bootinfo.c:231:13: warning: implicit declaration of function 'getrandom'; did you mean 'srandom'? [-Wimplicit-function-declaration] 231 | if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) { | ^~~~~~~~~ | srandom kexec/arch/m68k/bootinfo.c:231:56: error: 'GRND_NONBLOCK' undeclared (first use in this function) 231 | if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) { | ^~~~~~~~~~~~~ Fixes: b9de05184816 ("m68k: pass rng seed via BI_RNG_SEED") Cc: Jason@zx2c4.com Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Simon Horman <horms@kernel.org>
-rw-r--r--kexec/arch/m68k/bootinfo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 086a34bd..5afd212d 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>