summaryrefslogtreecommitdiff
path: root/src/tty.c
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amade@asmblr.net>2018-05-24 14:58:37 +0200
committerAmadeusz Sławiński <amade@asmblr.net>2018-05-31 14:34:29 +0200
commite2a3b9ba24450e06cec32b841218295e4602b5ce (patch)
treef095c4b486c3d6332bb7d3f3f24a7d07804ced36 /src/tty.c
parentdbe1eb72b21a159a5d7e88fc5f39ae2174578259 (diff)
downloadscreen-e2a3b9ba24450e06cec32b841218295e4602b5ce.tar.gz
check if we succeeded in SttyMode
should detect invalid parameters, like bad baud modes Bug: 50849
Diffstat (limited to 'src/tty.c')
-rw-r--r--src/tty.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tty.c b/src/tty.c
index ad3cdfc..e06ef46 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -132,7 +132,14 @@ int OpenTTY(char *line, char *opt)
*/
InitTTY(&Mode, W_TYPE_PLAIN);
- SttyMode(&Mode, opt);
+
+ if (SttyMode(&Mode, opt)) {
+ Msg(errno, "%s: stty failed - invalid option?", line);
+ alarm(0);
+ xsignal(SIGALRM, sigalrm);
+ close(f);
+ return -1;
+ }
SetTTY(f, &Mode);
#if defined(TIOCMSET)