summaryrefslogtreecommitdiffstats
path: root/sshtty.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-09 12:26:23 +0100
committerDarren Tucker <dtucker@zip.com.au>2010-01-09 12:26:23 +0100
commit37c1b3d6fc9043123f33e64051ea56656a5e7ef4 (patch)
tree644c0ffdcb779ac87c50a223f39ded86570f48a3 /sshtty.c
parent - jmc@cvs.openbsd.org 2010/01/09 03:36:00 (diff)
downloadopenssh-37c1b3d6fc9043123f33e64051ea56656a5e7ef4.tar.xz
openssh-37c1b3d6fc9043123f33e64051ea56656a5e7ef4.zip
- djm@cvs.openbsd.org 2010/01/09 05:04:24
[mux.c sshpty.h clientloop.c sshtty.c] quell tc[gs]etattr warnings when forcing a tty (ssh -tt), since we usually don't actually have a tty to read/set; bz#1686 ok dtucker@
Diffstat (limited to 'sshtty.c')
-rw-r--r--sshtty.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sshtty.c b/sshtty.c
index 21ade4e51..d214ce3bb 100644
--- a/sshtty.c
+++ b/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.14 2010/01/09 05:04:24 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -54,23 +54,25 @@ get_saved_tio(void)
}
void
-leave_raw_mode(void)
+leave_raw_mode(int quiet)
{
if (!_in_raw_mode)
return;
- if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1)
- perror("tcsetattr");
- else
+ if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1) {
+ if (!quiet)
+ perror("tcsetattr");
+ } else
_in_raw_mode = 0;
}
void
-enter_raw_mode(void)
+enter_raw_mode(int quiet)
{
struct termios tio;
if (tcgetattr(fileno(stdin), &tio) == -1) {
- perror("tcgetattr");
+ if (!quiet)
+ perror("tcgetattr");
return;
}
_saved_tio = tio;
@@ -86,8 +88,9 @@ enter_raw_mode(void)
tio.c_oflag &= ~OPOST;
tio.c_cc[VMIN] = 1;
tio.c_cc[VTIME] = 0;
- if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1)
- perror("tcsetattr");
- else
+ if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1) {
+ if (!quiet)
+ perror("tcsetattr");
+ } else
_in_raw_mode = 1;
}