-/* $OpenBSD: sshtty.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: sshtty.c,v 1.1 2001/04/14 16:33:20 stevesk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include "includes.h"
-#include <sys/types.h>
-#include <stdio.h>
-#include <termios.h>
-#include <pwd.h>
-
-#include "sshpty.h"
+#include "sshtty.h"
+#include "log.h"
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)
{
perror("tcsetattr");
else
_in_raw_mode = 0;
+
+ fatal_remove_cleanup((void (*) (void *)) leave_raw_mode, NULL);
}
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;
perror("tcsetattr");
else
_in_raw_mode = 1;
+
+ fatal_add_cleanup((void (*) (void *)) leave_raw_mode, NULL);
}