iEnforce a terminal size to reduce race conditions in too efficient apps. - st - Simple Terminal Err gopher.r-36.net 70 i Err gopher.r-36.net 70 1Log /scm/st//log.gph gopher.r-36.net 70 1Files /scm/st//files.gph gopher.r-36.net 70 1Refs /scm/st//refs.gph gopher.r-36.net 70 1README /scm/st//file/README.gph gopher.r-36.net 70 1LICENSE /scm/st//file/LICENSE.gph gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1commit 504a165277c13797840c42c64807b59cd4e5f3a5 /scm/st//commit/504a165277c13797840c42c64807b59cd4e5f3a5.gph gopher.r-36.net 70 1parent 9031e228ce283cd4847832acf012a910f74ad1ed /scm/st//commit/9031e228ce283cd4847832acf012a910f74ad1ed.gph gopher.r-36.net 70 hAuthor: Christoph Lohmann <20h@r-36.net> URL:mailto:20h@r-36.net gopher.r-36.net 70 iDate: Thu, 28 Jan 2016 18:09:11 +0100 Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iEnforce a terminal size to reduce race conditions in too efficient apps. Err gopher.r-36.net 70 i Err gopher.r-36.net 70 idvtm is too fast in starting up. It will then have a race condition in finding Err gopher.r-36.net 70 ithe right. terminal size. Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iDiffstat: Err gopher.r-36.net 70 i st.c | 2 ++ Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i1 file changed, 2 insertions(+), 0 deletions(-) Err gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1diff --git a/st.c b/st.c /scm/st//file/st.c.gph gopher.r-36.net 70 i@@ -1440,6 +1440,8 @@ ttynew(void) Err gopher.r-36.net 70 i if (openpty(&m, &s, NULL, NULL, &w) < 0) Err gopher.r-36.net 70 i die("openpty failed: %s\n", strerror(errno)); Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i+ ttyresize(); Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i switch (pid = fork()) { Err gopher.r-36.net 70 i case -1: Err gopher.r-36.net 70 i die("fork failed\n"); Err gopher.r-36.net 70 .