aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Pilling2013-06-19 21:24:01 +0100
committerChristoph Lohmann2013-10-27 13:17:11 +0100
commitd5601246c7dc693c45242de09911fc5698aa3340 (patch)
tree1541672923aab6346804d78cacf198dec79d3e98
parent7009925853014c666aa14af0288fc4ba7b8d47b6 (diff)
downloadaur-d5601246c7dc693c45242de09911fc5698aa3340.tar.gz
Fixed lock up when system time jumps backwards
Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r--st.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/st.c b/st.c
index 50b58a77e408..d0a621875289 100644
--- a/st.c
+++ b/st.c
@@ -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);
@@ -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;
}