[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] [PATCH 2/8] Compile libvirt under Windows (Cygwin)



'cfmakeraw' is a BSD function. If we don't have it, inline the equivalent code instead.

Rich.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
Index: configure.in
===================================================================
RCS file: /data/cvs/libvirt/configure.in,v
retrieving revision 1.90
diff -u -r1.90 configure.in
--- configure.in	30 Sep 2007 21:09:29 -0000	1.90
+++ configure.in	24 Nov 2007 14:09:50 -0000
@@ -61,7 +61,7 @@
 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)
Index: src/console.c
===================================================================
RCS file: /data/cvs/libvirt/src/console.c,v
retrieving revision 1.2
diff -u -r1.2 console.c
--- src/console.c	28 Jan 2007 19:47:36 -0000	1.2
+++ src/console.c	24 Nov 2007 14:09:50 -0000
@@ -20,6 +20,8 @@
  * Daniel Berrange <berrange redhat com>
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -71,7 +73,16 @@
     }
 
     rawattr = ttyattr;
+#ifdef HAVE_CFMAKERAW
     cfmakeraw(&rawattr);
+#else
+    rawattr.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
+                         | INLCR | IGNCR | ICRNL | IXON);
+    rawattr.c_oflag &= ~OPOST;
+    rawattr.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
+    rawattr.c_cflag &= ~(CSIZE | PARENB);
+    rawattr.c_cflag |= CS8;
+#endif
 
     if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &rawattr) < 0) {
         fprintf(stderr, _("unable to set tty attributes: %s\n"),

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]