Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69fada32 authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds
Browse files

[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 <ak@suse.de>
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1b4ad242
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -80,11 +80,18 @@ void setup_machinename(char *machine_out)
	struct utsname host;
	struct utsname host;


	uname(&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")) {
	if (!strcmp(host.machine, "x86_64")) {
		strcpy(machine_out, "i686");
		strcpy(machine_out, "i686");
		return;
		return;
	}
	}
# else
	if (!strcmp(host.machine, "i686")) {
		strcpy(machine_out, "x86_64");
		return;
	}
# endif
#endif
#endif
	strcpy(machine_out, host.machine);
	strcpy(machine_out, host.machine);
}
}