summaryrefslogtreecommitdiffstats
path: root/sys-utils/setarch.c
diff options
context:
space:
mode:
authorAndreas Schwab2019-01-19 23:18:16 +0100
committerKarel Zak2019-01-22 12:02:16 +0100
commit33e87bf1524baa215413cbcb26668e600a7b5cb8 (patch)
tree137b2f89cf9c9abdc39da14556e91d37bc098077 /sys-utils/setarch.c
parentlosetup: update an error message (diff)
downloadkernel-qcow2-util-linux-33e87bf1524baa215413cbcb26668e600a7b5cb8.tar.gz
kernel-qcow2-util-linux-33e87bf1524baa215413cbcb26668e600a7b5cb8.tar.xz
kernel-qcow2-util-linux-33e87bf1524baa215413cbcb26668e600a7b5cb8.zip
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 <schwab@linux-m68k.org>
Diffstat (limited to 'sys-utils/setarch.c')
-rw-r--r--sys-utils/setarch.c2
1 files changed, 1 insertions, 1 deletions
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[] =