summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)