3
0
forked from pool/util-linux
util-linux/tty3270-on-serial-line-of-s390.patch

35 lines
1.4 KiB
Diff

Support the special terminal on first serial line on a S/390(x) which
is due legacy reasons a block terminal of type 3270 or higher. Whereas
the second serial line on a S/390(x) is a real character terminal which
is compatible with VT220.
---
term-utils/agetty.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Index: util-linux-2.24.1/term-utils/agetty.c
===================================================================
--- util-linux-2.24.1.orig/term-utils/agetty.c 2014-02-09 21:19:01.000000000 +0000
+++ util-linux-2.24.1/term-utils/agetty.c 2014-02-09 21:19:27.000000000 +0000
@@ -1042,6 +1042,20 @@ static void open_tty(char *tty, struct t
/* make stdio unbuffered for slow modem lines */
setvbuf(stdout, NULL, _IONBF, 0);
+#if defined (__s390__) || defined (__s390x__)
+ if (!op->term) {
+ /*
+ * Special terminal on first serial line on a S/390(x) which
+ * is due legacy reasons a block terminal of type 3270 or
+ * higher. Whereas the second serial line on a S/390(x) is
+ * a real character terminal which is compatible with VT220.
+ */
+ if (strcmp(op->tty, "ttyS0") == 0 || strncmp(op->tty, "3270/tty", 8) == 0)
+ op->term = DEFAULT_TTYS0;
+ else if (strcmp(op->tty, "ttyS1") == 0)
+ op->term = DEFAULT_TTYS1;
+ }
+#endif
/*
* The following ioctl will fail if stdin is not a tty, but also when
* there is noise on the modem control lines. In the latter case, the