X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/22616013c4eef383b19b8ad4f95780a316d0a51b..c8b33f201dc1568673002a11f4307700e502d0d6:/openssh/sshtty.c diff --git a/openssh/sshtty.c b/openssh/sshtty.c index 21ade4e..7849890 100644 --- a/openssh/sshtty.c +++ b/openssh/sshtty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshtty.c,v 1.13 2008/05/19 15:45:07 djm Exp $ */ +/* $OpenBSD: sshtty.c,v 1.1 2001/04/14 16:33:20 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,20 +37,22 @@ #include "includes.h" -#include -#include -#include -#include - -#include "sshpty.h" +#include "sshtty.h" +#include "log.h" static struct termios _saved_tio; static int _in_raw_mode = 0; -struct termios * +int +in_raw_mode(void) +{ + return _in_raw_mode; +} + +struct termios get_saved_tio(void) { - return _in_raw_mode ? &_saved_tio : NULL; + return _saved_tio; } void @@ -62,6 +64,8 @@ leave_raw_mode(void) perror("tcsetattr"); else _in_raw_mode = 0; + + fatal_remove_cleanup((void (*) (void *)) leave_raw_mode, NULL); } void @@ -76,9 +80,6 @@ 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; @@ -90,4 +91,6 @@ enter_raw_mode(void) perror("tcsetattr"); else _in_raw_mode = 1; + + fatal_add_cleanup((void (*) (void *)) leave_raw_mode, NULL); }