From 33e87bf1524baa215413cbcb26668e600a7b5cb8 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sat, 19 Jan 2019 23:18:16 +0100 Subject: setarch: don't return address of automatic variable On architectures without special personalities setarch uses the contents of a local variable with automatic storage duration after return from the function, causing it to report a spurious error. $ setarch m68k setarch: Kernel cannot set architecture to m68k Signed-off-by: Andreas Schwab --- sys-utils/setarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys-utils/setarch.c') diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index 7c0a63fbb..703c36d86 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -131,7 +131,7 @@ static void __attribute__((__noreturn__)) usage(int archwrapper) */ static struct arch_domain *init_arch_domains(void) { - struct utsname un; + static struct utsname un; size_t i; static struct arch_domain transitions[] = -- cgit v1.2.3-55-g7522