summaryrefslogtreecommitdiffstats
path: root/util/qemu-openpty.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-29 16:17:27 +0200
committerPeter Maydell <peter.maydell@linaro.org>2014-06-11 00:25:06 +0100
commit6ad3f09bd457275f534810c2fce90fb03305a91a (patch)
treee4e7b1ae9c7bd681c541f8dea70a308fbe98c5f0 /util/qemu-openpty.c
parentb7b5233ad7fdd9985bb6d05b7919f3a20723ff2c (diff)
downloadhqemu-6ad3f09bd457275f534810c2fce90fb03305a91a.zip
hqemu-6ad3f09bd457275f534810c2fce90fb03305a91a.tar.gz
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 <ncopa@alpinelinux.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/qemu-openpty.c')
-rw-r--r--util/qemu-openpty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
index 4febfe9..4c53211 100644
--- a/util/qemu-openpty.c
+++ b/util/qemu-openpty.c
@@ -47,6 +47,8 @@
#elif defined CONFIG_SOLARIS
# include <termios.h>
# include <stropts.h>
+#else
+# include <termios.h>
#endif
#ifdef __sun__
OpenPOWER on IntegriCloud