From e6dc0418bcb96e3cccb80571f35934ed72e9c99a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 4 Jul 2013 11:22:58 +0930 Subject: lguest: fix example launcher compilation for broken glibc headers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Somehow a naked u16 slipped into the glibc headers on my Ubuntu machine (i386 2.17-0ubuntu5), breaking compile: In file included from lguest.c:46:0: /usr/include/linux/virtio_net.h:188:2: error: unknown type name ‘u16’ We use the kernel-style types anyway, just define them before the includes. Also remove the advice on adding missing headers: that no longer works. Signed-off-by: Rusty Russell --- tools/lguest/Makefile | 1 - tools/lguest/lguest.c | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/lguest/Makefile b/tools/lguest/Makefile index 0ac34206f7a7..97bca4871ea3 100644 --- a/tools/lguest/Makefile +++ b/tools/lguest/Makefile @@ -1,5 +1,4 @@ # This creates the demonstration utility "lguest" which runs a Linux guest. -# Missing headers? Add "-I../../../include -I../../../arch/x86/include" CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE all: lguest diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index a64f5cb0c15b..68f67cf3d318 100644 --- a/tools/lguest/lguest.c +++ b/tools/lguest/lguest.c @@ -42,14 +42,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include "../../include/linux/lguest_launcher.h" /*L:110 * We can ignore the 43 include files we need for this program, but I do want * to draw attention to the use of kernel-style types. @@ -65,6 +57,15 @@ typedef uint16_t u16; typedef uint8_t u8; /*:*/ +#include +#include +#include +#include +#include +#include +#include +#include "../../include/linux/lguest_launcher.h" + #define BRIDGE_PFX "bridge:" #ifndef SIOCBRADDIF #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ -- cgit v1.2.3