From: Natanael Copa Date: Tue, 29 Apr 2014 14:17:27 +0000 (+0200) Subject: util/qemu-openpty: fix build with musl libc by include termios.h as fallback X-Git-Tag: v2.1.0-rc0~64^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ad3f09bd457275f534810c2fce90fb03305a91a;p=thirdparty%2Fqemu.git util/qemu-openpty: fix build with musl libc by include termios.h as fallback Include termios.h as POSIX fallback when not glibc, bsd or solaris. POSIX says that termios.h should define struct termios and TCAFLUSH. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html This fixes the following compile errors with musl libc: util/qemu-openpty.c: In function 'qemu_openpty_raw': util/qemu-openpty.c:112:20: error: storage size of 'tty' isn't known struct termios tty; ^ ... util/qemu-openpty.c:128:24: error: 'TCSAFLUSH' undeclared (first use in this function) tcsetattr(*aslave, TCSAFLUSH, &tty); ^ Signed-off-by: Natanael Copa Reviewed-by: Paolo Bonzini Signed-off-by: Peter Maydell --- diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c index 4febfe9d724..4c5321116ba 100644 --- a/util/qemu-openpty.c +++ b/util/qemu-openpty.c @@ -47,6 +47,8 @@ #elif defined CONFIG_SOLARIS # include # include +#else +# include #endif #ifdef __sun__