summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@mips.inka.de>2016-01-13 21:46:29 +0100
committerMatthieu Herrb <matthieu@herrb.eu>2016-01-13 21:46:29 +0100
commitb47ddf1e1ca6fca8b7888bdf4d7507381262d0c3 (patch)
tree25ccccf68c4796f9692956650a738156f6c72de5
parent3f007b38a3951dd4f8d5c3ccc247ebeed4b9a8c6 (diff)
Fix LNEXT handling on BSD
http://marc.info/?l=openbsd-misc&m=145123363601391&w=2 We need to turn off IEXTEN to make the tty transparent. I thought ICANON would cover this (as it does on Linux), but apparently it's a BSD-ism that LNEXT operates independently of ICANON. That isn't a bug either; both the OpenBSD code and the rather different FreeBSD code explicitly handle it this way. IEXTEN is part of POSIX, even if the actual behavior is "implementation-defined", so I don't think it needs an ifdef. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
-rw-r--r--sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys.c b/sys.c
index 8463b05..896c7bb 100644
--- a/sys.c
+++ b/sys.c
@@ -256,7 +256,7 @@ setRawTermios(void)
rc = tcgetattr(0, &tio);
if (rc < 0)
return rc;
- tio.c_lflag &= (unsigned) ~(ECHO | ICANON | ISIG);
+ tio.c_lflag &= (unsigned) ~(ECHO | ICANON | IEXTEN | ISIG);
tio.c_iflag &= (unsigned) ~(ICRNL | IXOFF | IXON | ISTRIP);
#ifdef ONLCR
tio.c_oflag &= (unsigned) ~ONLCR;