From 9df8b20d1632d108da316134d4d86a00b4028803 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 29 Jun 2020 14:13:24 +0200 Subject: configure / util: Auto-detect the availability of openpty() Recent versions of Solaris (v11.4) now feature an openpty() function, too, causing a build failure since we ship our own implementation of openpty() for Solaris in util/qemu-openpty.c so far. Since there are now both variants available in the wild, with and without this function (and illumos is said to not have this function yet), let's introduce a proper HAVE_OPENPTY define for this to fix the build failure. Message-Id: <20200702143955.678-1-thuth@redhat.com> Tested-by: Michele Denber Signed-off-by: Thomas Huth --- util/qemu-openpty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c index 2e8b43b..4b8df96 100644 --- a/util/qemu-openpty.c +++ b/util/qemu-openpty.c @@ -52,7 +52,9 @@ #endif #ifdef __sun__ -/* Once Solaris has openpty(), this is going to be removed. */ + +#if !defined(HAVE_OPENPTY) +/* Once illumos has openpty(), this is going to be removed. */ static int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) { @@ -93,6 +95,7 @@ err: close(mfd); return -1; } +#endif static void cfmakeraw (struct termios *termios_p) { -- cgit v1.1