[PATCH luit] Fix LNEXT handling on BSD

Matthieu Herrb matthieu at herrb.eu
Wed Jan 13 12:52:16 PST 2016


From: Christian Weisgerber <naddy at mips.inka.de>

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 at herrb.eu>
---
 sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git sys.c sys.c
index 8463b05..896c7bb 100644
--- sys.c
+++ 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;
-- 
2.6.4



More information about the xorg-devel mailing list