summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/getty/main.c12
-rw-r--r--libexec/rlogind/rlogind.c9
2 files changed, 12 insertions, 9 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index ad53411..ced1573 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -454,8 +454,9 @@ opentty(const char *tty, int flags)
}
static void
-defttymode()
+defttymode(void)
{
+ struct termios def;
/* Start with default tty settings. */
if (tcgetattr(STDIN_FILENO, &tmode) < 0) {
@@ -471,10 +472,11 @@ defttymode()
* to leave their idea of the preferred VERASE key value
* there.
*/
- tmode.c_iflag = TTYDEF_IFLAG;
- tmode.c_oflag = TTYDEF_OFLAG;
- tmode.c_lflag = TTYDEF_LFLAG;
- tmode.c_cflag = TTYDEF_CFLAG;
+ cfmakesane(&def);
+ tmode.c_iflag = def.c_iflag;
+ tmode.c_oflag = def.c_oflag;
+ tmode.c_lflag = def.c_lflag;
+ tmode.c_cflag = def.c_cflag;
if (NC)
tmode.c_cflag |= CLOCAL;
omode = tmode;
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index 5831a25..874112d 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -545,7 +545,7 @@ setup_term(int fd)
{
char *cp = index(term+ENVSIZE, '/');
char *speed;
- struct termios tt;
+ struct termios tt, def;
#ifndef notyet
tcgetattr(fd, &tt);
@@ -558,9 +558,10 @@ setup_term(int fd)
cfsetspeed(&tt, atoi(speed));
}
- tt.c_iflag = TTYDEF_IFLAG;
- tt.c_oflag = TTYDEF_OFLAG;
- tt.c_lflag = TTYDEF_LFLAG;
+ cfmakesane(&def);
+ tt.c_iflag = def.c_iflag;
+ tt.c_oflag = def.c_oflag;
+ tt.c_lflag = def.c_lflag;
tcsetattr(fd, TCSAFLUSH, &tt);
#else
if (cp) {
OpenPOWER on IntegriCloud