xenconsole: Compile fixes for console code on Solaris
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 11 Mar 2009 10:08:31 +0000 (10:08 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 11 Mar 2009 10:08:31 +0000 (10:08 +0000)
Signed-off-by: John Levon <john.levon@sun.com>
tools/console/client/main.c
tools/console/daemon/main.c

index 509e44bf91a52ac17122c86174b1c6a41636688c..6fb41114b6c914d0e60de72ee2fb6a91dab34c56 100644 (file)
@@ -71,6 +71,21 @@ static void usage(const char *program) {
               , program);
 }
 
+#ifdef __sun__
+void cfmakeraw (struct termios *termios_p)
+{
+       termios_p->c_iflag &=
+           ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+       termios_p->c_oflag &= ~OPOST;
+       termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+       termios_p->c_cflag &= ~(CSIZE|PARENB);
+       termios_p->c_cflag |= CS8;
+
+       termios_p->c_cc[VMIN] = 0;
+       termios_p->c_cc[VTIME] = 0;
+}
+#endif
+
 static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 /* Check for a pty in xenstore, open it and return its fd.
  * Assumes there is already a watch set in the store for this path. */
index c1529d0ac2b1c6fb7935611ff88a2b1e74f11def..60faa4bb2a2ca45430158656299228713bc7b92e 100644 (file)
@@ -86,7 +86,9 @@ int main(int argc, char **argv)
                        version(argv[0]);
                        exit(0);
                case 'v':
+#ifndef __sun__
                        syslog_option |= LOG_PERROR;
+#endif
                        syslog_mask = LOG_DEBUG;
                        break;
                case 'i':