X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/12408a1b16c3ce5b7e203bec879ceb3d67ae09a8..196fbaad2b9568f127b7070b562f40ba71078d71:/openssh/sshtty.c diff --git a/openssh/sshtty.c b/openssh/sshtty.c index 4fb2d3d..7849890 100644 --- a/openssh/sshtty.c +++ b/openssh/sshtty.c @@ -1,3 +1,4 @@ +/* $OpenBSD: sshtty.c,v 1.1 2001/04/14 16:33:20 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -35,7 +36,6 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshtty.c,v 1.5 2003/09/19 17:43:35 markus Exp $"); #include "sshtty.h" #include "log.h" @@ -43,6 +43,12 @@ RCSID("$OpenBSD: sshtty.c,v 1.5 2003/09/19 17:43:35 markus Exp $"); static struct termios _saved_tio; static int _in_raw_mode = 0; +int +in_raw_mode(void) +{ + return _in_raw_mode; +} + struct termios get_saved_tio(void) { @@ -58,6 +64,8 @@ leave_raw_mode(void) perror("tcsetattr"); else _in_raw_mode = 0; + + fatal_remove_cleanup((void (*) (void *)) leave_raw_mode, NULL); } void @@ -72,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; @@ -86,4 +91,6 @@ enter_raw_mode(void) perror("tcsetattr"); else _in_raw_mode = 1; + + fatal_add_cleanup((void (*) (void *)) leave_raw_mode, NULL); }