]> xenbits.xensource.com Git - xen.git/commitdiff
Fix tools/console to build on NetBSD.
authorKeir Fraser <keir@xensource.com>
Thu, 20 Sep 2007 15:02:22 +0000 (16:02 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 20 Sep 2007 15:02:22 +0000 (16:02 +0100)
 - include headers needed to build on NetBSD
 - Remove unused pty.h
 - Initialize spty terminal before actually using it

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
tools/console/client/main.c
tools/console/daemon/utils.c

index b7a45212a0c7b87f1da07852ac9e87b6ae10801b..509e44bf91a52ac17122c86174b1c6a41636688c 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/select.h>
 #include <err.h>
 #include <errno.h>
-#include <pty.h>
+#include <string.h>
 
 #include "xs.h"
 
@@ -113,9 +113,8 @@ static void init_term(int fd, struct termios *old)
 {
        struct termios new_term;
 
-       if (tcgetattr(fd, old) == -1) {
+       if (tcgetattr(fd, old) == -1)
                return;
-       }
 
        new_term = *old;
        cfmakeraw(&new_term);
@@ -289,6 +288,7 @@ int main(int argc, char **argv)
                err(errno, "Could not read tty from store");
        }
 
+       init_term(spty, &attr);
        init_term(STDIN_FILENO, &attr);
        console_loop(spty, xs, path);
        restore_term(STDIN_FILENO, &attr);
index 6697e135270d194e89b76286638f6c7427a02153..657bfa0cdede712f926ba7ca25ffb6037949d61d 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <string.h>
+#include <signal.h>
 
 #include "xenctrl.h"
 #include "utils.h"