From: Paolo 'Blaisorblade' Giarrusso Date: Wed, 11 Oct 2006 08:21:36 +0000 (-0700) Subject: [PATCH] uml: fix uname under setarch i386 X-Git-Tag: v2.6.19-rc2~91 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69fada32d868d7f4be128ea4df8fbe4fd897fc34;p=linux-2.6 [PATCH] uml: fix uname under setarch i386 On a 64bit Uml, if run under "setarch i386" (which a user did), uname() currently returns the obtained i686 as machine - fix that. Btw, I'm quite surprised that under setarch i386 a 64-bit binary can run. Cc: Andi Kleen Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c index 3f5b1514e8..56b8a50e8b 100644 --- a/arch/um/os-Linux/util.c +++ b/arch/um/os-Linux/util.c @@ -80,11 +80,18 @@ void setup_machinename(char *machine_out) struct utsname host; uname(&host); -#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT) +#ifdef UML_CONFIG_UML_X86 +# ifndef UML_CONFIG_64BIT if (!strcmp(host.machine, "x86_64")) { strcpy(machine_out, "i686"); return; } +# else + if (!strcmp(host.machine, "i686")) { + strcpy(machine_out, "x86_64"); + return; + } +# endif #endif strcpy(machine_out, host.machine); }