Mon Nov 26 12:12:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>

* configure.in, src/console.c: Replace cfmakeraw if not in
	  standard library.
This commit is contained in:
Richard W.M. Jones 2007-11-26 12:14:32 +00:00
parent b7641686a6
commit 851c651820
3 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Mon Nov 26 12:12:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in, src/console.c: Replace cfmakeraw if not in
standard library.
Mon Nov 26 12:03:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* tests/Makefile.am, tests/nodeinfotest.c, tests/qemuxml2argvtest.c,

View File

@ -61,7 +61,7 @@ AM_PROG_CC_C_O
LIBVIRT_COMPILE_WARNINGS(maximum)
dnl Availability of various common functions (non-fatal if missing).
AC_CHECK_FUNCS([regexec])
AC_CHECK_FUNCS([regexec cfmakeraw])
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([paths.h sys/syslimits.h])

View File

@ -20,6 +20,8 @@
* Daniel Berrange <berrange@redhat.com>
*/
#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -42,6 +44,19 @@ static void do_signal(int sig ATTRIBUTE_UNUSED) {
got_signal = 1;
}
#ifndef HAVE_CFMAKERAW
static void
cfmakeraw (struct termios *attr)
{
attr->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
| INLCR | IGNCR | ICRNL | IXON);
attr->c_oflag &= ~OPOST;
attr->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
attr->c_cflag &= ~(CSIZE | PARENB);
attr->c_cflag |= CS8;
}
#endif /* !HAVE_CFMAKERAW */
int vshRunConsole(const char *tty) {
int ttyfd, ret = -1;
struct termios ttyattr, rawattr;