[hackers] [st] Enforce a terminal size to reduce race conditions in too efficient apps. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Thu, 28 Jan 2016 18:10:10 +0100 (CET)

commit 504a165277c13797840c42c64807b59cd4e5f3a5
Author: Christoph Lohmann <20h_AT_r-36.net>
AuthorDate: Thu Jan 28 18:09:11 2016 +0100
Commit: Christoph Lohmann <20h_AT_r-36.net>
CommitDate: Thu Jan 28 18:09:11 2016 +0100

    Enforce a terminal size to reduce race conditions in too efficient apps.
    
    dvtm is too fast in starting up. It will then have a race condition in finding
    the right. terminal size.

diff --git a/st.c b/st.c
index 98622ec..3a0a519 100644
--- a/st.c
+++ b/st.c
_AT_@ -1440,6 +1440,8 @@ ttynew(void)
         if (openpty(&m, &s, NULL, NULL, &w) < 0)
                 die("openpty failed: %s\n", strerror(errno));
 
+ ttyresize();
+
         switch (pid = fork()) {
         case -1:
                 die("fork failed\n");
Received on Thu Jan 28 2016 - 18:10:10 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 28 2016 - 18:12:20 CET