summaryrefslogtreecommitdiff
path: root/system/expect/linux-5.10-tty.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-02-06 15:29:03 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-05-01 17:05:47 -0500
commit01c8c9c6bd56e3c118056bf18dd84daadc5fa3ae (patch)
treebe412c2a85a4439362dfb3e3218a669f2a0ac03c /system/expect/linux-5.10-tty.patch
parentf40b0b74b6c438c7e482afc51df523d96b949539 (diff)
downloadpackages-01c8c9c6bd56e3c118056bf18dd84daadc5fa3ae.tar.gz
packages-01c8c9c6bd56e3c118056bf18dd84daadc5fa3ae.tar.bz2
packages-01c8c9c6bd56e3c118056bf18dd84daadc5fa3ae.tar.xz
packages-01c8c9c6bd56e3c118056bf18dd84daadc5fa3ae.zip
system/expect: Patch for weird Linux TTY error
Linux TTY behaviour changed somewhere between 5.4 and 5.10. This causes the DejaGNU test suite to fail (among others). Found on gwyn running easy-kernel 5.15.11-mc1.
Diffstat (limited to 'system/expect/linux-5.10-tty.patch')
-rw-r--r--system/expect/linux-5.10-tty.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/system/expect/linux-5.10-tty.patch b/system/expect/linux-5.10-tty.patch
new file mode 100644
index 000000000..807f519b2
--- /dev/null
+++ b/system/expect/linux-5.10-tty.patch
@@ -0,0 +1,25 @@
+From: Adam Sampson <ats@offog.org>
+Subject: Re: dejagnu-1.6.3 test failure
+Message-ID: <YXNTBvEAQP0jAgiq@cartman.at.offog.org>
+
+After a bit of debugging, the cause seems to be that expect uses
+Tcl_GetsObj to read from stdin, and treats a -1 return value as an
+error. However, Tcl_GetsObj can also return -1 to indicate that input
+was blocked, i.e. it didn't manage to read a complete line -- expect
+didn't handle this case.
+
+This patch seems to fix the problem:
+
+--- expect5.45.4/exp_main_sub.c 2018-02-04 10:43:58.000000000 +0000
++++ expect5.45.4/exp_main_sub.c 2021-10-23 00:39:09.375404444 +0100
+@@ -326,7 +326,9 @@
+
+ if (code != EXP_EOF) {
+ inChannel = expStdinoutGet()->channel;
+- code = Tcl_GetsObj(inChannel, commandPtr);
++ do {
++ code = Tcl_GetsObj(inChannel, commandPtr);
++ } while (code < 0 && Tcl_InputBlocked(inChannel));
+ #ifdef SIMPLE_EVENT
+ if (code == -1 && errno == EINTR) {
+ if (Tcl_AsyncReady()) {