]> andersk Git - openssh.git/blobdiff - sshtty.c
- (dtucker) [misc.c] Move the routingdomain ifdef to allow the socket to
[openssh.git] / sshtty.c
index 5c016f80af87a42bd9e891048ea58a494d202480..21ade4e5153dc6ec9ab790ab728700f3049ec813 100644 (file)
--- a/sshtty.c
+++ b/sshtty.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: sshtty.c,v 1.13 2008/05/19 15:45:07 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshtty.c,v 1.3 2002/03/04 17:27:39 stevesk Exp $");
 
-#include "sshtty.h"
-#include "log.h"
+#include <sys/types.h>
+#include <stdio.h>
+#include <termios.h>
+#include <pwd.h>
+
+#include "sshpty.h"
 
 static struct termios _saved_tio;
 static int _in_raw_mode = 0;
 
-int
-in_raw_mode(void)
-{
-       return _in_raw_mode;
-}
-
-struct termios
+struct termios *
 get_saved_tio(void)
 {
-       return _saved_tio;
+       return _in_raw_mode ? &_saved_tio : NULL;
 }
 
 void
@@ -64,8 +62,6 @@ leave_raw_mode(void)
                perror("tcsetattr");
        else
                _in_raw_mode = 0;
-
-       fatal_remove_cleanup((void (*) (void *)) leave_raw_mode, NULL);
 }
 
 void
@@ -80,6 +76,9 @@ enter_raw_mode(void)
        _saved_tio = tio;
        tio.c_iflag |= IGNPAR;
        tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
+#ifdef IUCLC
+       tio.c_iflag &= ~IUCLC;
+#endif
        tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
 #ifdef IEXTEN
        tio.c_lflag &= ~IEXTEN;
@@ -91,6 +90,4 @@ enter_raw_mode(void)
                perror("tcsetattr");
        else
                _in_raw_mode = 1;
-
-       fatal_add_cleanup((void (*) (void *)) leave_raw_mode, NULL);
 }
This page took 0.055796 seconds and 4 git commands to generate.