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 <denber@mindspring.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Thomas Huth 2020-06-29 14:13:24 +02:00
parent 51b3ca9759
commit 9df8b20d16
2 changed files with 12 additions and 2 deletions

View file

@ -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)
{