Recently Written · git

sacc

Mirror of git://bitreich.org/sacc, the sacc gopher client from bitreich.org.

git clone https://github.com/equwal/sacc

Log | Files | Refs


commit c0a79c0424a99180ed4c79e3335dc3f7ced2322c
Hiltjo Posthuma <hiltjo@codemadness.org>
2020-08-19 22:57:57 +0200

ui_ti: explicitly define VMIN and VTIME values for read()

VMIN represents the minimum number of bytes that should be received when the
read(2) function successfully returns.

VTIME is a timer of 0.1 second granularity that is used to time out bursty and
short term data transmissions.

On some systems VMIN is not 1 causing input processing issues.

 ui_ti.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/ui_ti.c b/ui_ti.c
index 7b9256e..d62ec20 100644
--- a/ui_ti.c
+++ b/ui_ti.c
@@ -24,6 +24,8 @@ uisetup(void)
 	tcgetattr(0, &tsave);
 	tsacc = tsave;
 	tsacc.c_lflag &= ~(ECHO|ICANON);
+	tsacc.c_cc[VMIN] = 1;
+	tsacc.c_cc[VTIME] = 0;
 	tcsetattr(0, TCSANOW, &tsacc);
 
 	setupterm(NULL, 1, NULL);