summaryrefslogtreecommitdiffstats
path: root/usr.bin/mg/ttyio.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2000-02-27 17:30:40 +0000
committermillert <millert@openbsd.org>2000-02-27 17:30:40 +0000
commit381e9cc192b69216f8e34c06aaa659f0bbe3897f (patch)
tree887de244f211e0a19e91894e9e421588e75fbf92 /usr.bin/mg/ttyio.c
parentDon't define -DDO_METAKEY twice (diff)
downloadwireguard-openbsd-381e9cc192b69216f8e34c06aaa659f0bbe3897f.tar.xz
wireguard-openbsd-381e9cc192b69216f8e34c06aaa659f0bbe3897f.zip
make this compile on systems w/o TCSASOFT
Diffstat (limited to 'usr.bin/mg/ttyio.c')
-rw-r--r--usr.bin/mg/ttyio.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c
index 5870d6cb901..236c26e274a 100644
--- a/usr.bin/mg/ttyio.c
+++ b/usr.bin/mg/ttyio.c
@@ -17,6 +17,10 @@
#define NOBUF 512 /* Output buffer size. */
+#ifndef TCSASOFT
+#define TCSASOFT 0
+#endif
+
char obuf[NOBUF]; /* Output buffer. */
int nobuf; /* buffer count */
@@ -55,6 +59,16 @@ ttopen()
nt.c_oflag &= ~OPOST;
nt.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+#if !TCSASOFT
+ /*
+ * If we don't have TCSASOFT, force terminal to
+ * 8 bits, no parity.
+ */
+ nt.c_iflag &= ~ISTRIP;
+ nt.c_cflag &= ~(CSIZE|PARENB);
+ nt.c_cflag |= CS8;
+#endif
+
ttysavedp = TRUE;
}