]> xenbits.xensource.com Git - libvirt.git/commitdiff
Mon Nov 26 12:12:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 26 Nov 2007 12:14:32 +0000 (12:14 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 26 Nov 2007 12:14:32 +0000 (12:14 +0000)
* configure.in, src/console.c: Replace cfmakeraw if not in
  standard library.

ChangeLog
configure.in
src/console.c

index 6086350f6ce4cf3926547c369549ad74eacf442e..b283e7787a141b327246c91767e129d21e2a8fed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
index 5c8582f7643060dcb8641d14fc80d5ed2e1098b4..6247d9c7d916120c25ea67d69eba1d45e2734d32 100644 (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])
index 1342887ad2406ce70f4e7e55376015504b58953e..ab83fcf800be72a704eedc08e9d394865cb10e00 100644 (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;