[hackers] [st] Fixed lock up when system time jumps backwards || Rob Pilling

From: <git_AT_suckless.org>
Date: Sun, 27 Oct 2013 13:17:55 +0100

commit 489982d4b8442af25a380f8c22be542055cda81f
Author: Rob Pilling <rob_AT_egbert>
Date: Wed Jun 19 21:24:01 2013 +0100

    Fixed lock up when system time jumps backwards
    
    Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>

diff --git a/st.c b/st.c
index 50b58a7..d0a6218 100644
--- a/st.c
+++ b/st.c
_AT_@ -3687,6 +3687,8 @@ run(void) {
         gettimeofday(&last, NULL);
 
         for(xev = actionfps;;) {
+ long deltatime;
+
                 FD_ZERO(&rfd);
                 FD_SET(cmdfd, &rfd);
                 FD_SET(xfd, &rfd);
_AT_@ -3720,8 +3722,9 @@ run(void) {
                         gettimeofday(&lastblink, NULL);
                         dodraw = 1;
                 }
- if(TIMEDIFF(now, last) \
- > (xev? (1000/xfps) : (1000/actionfps))) {
+ deltatime = TIMEDIFF(now, last);
+ if(deltatime > (xev? (1000/xfps) : (1000/actionfps))
+ || deltatime < 0) {
                         dodraw = 1;
                         last = now;
                 }
Received on Sun Oct 27 2013 - 13:17:55 CET

This archive was generated by hypermail 2.3.0 : Sun Oct 27 2013 - 13:24:26 CET