Prevent server from stalling if time goes backwards (M. Vallevand)

This commit is contained in:
mmdolze
2009-02-24 21:09:52 +00:00
parent 6b4c2d917b
commit 71c2f5cf18
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -62,6 +62,7 @@ v.0.5dev (ongoing development)
+ new driver irtrans (Phant0m / Aron Parsons)
+ serialVFD driver: support Siemens/Wincor Nixdorf BA63/66 (Stefan Herdler)
+ new client lcdident.pl (Ethan Dicks)
* server: prevent stalling if time goes backwards (M. Vallevand)
v.0.5.2
* fix switching on/off the Load screen in lcdproc client using the menu
+1 -1
View File
@@ -810,7 +810,7 @@ do_mainloop(void)
#ifndef WIN32
gettimeofday(&t, NULL);
t_diff = t.tv_sec - last_t.tv_sec;
if ((t_diff + 1) > (LONG_MAX / 1e6)) {
if ( ((t_diff + 1) > (LONG_MAX / 1e6)) || (t_diff < 0) ) {
/* We're going to overflow the calculation - probably been to sleep, fudge the values */
t_diff = 0;
process_lag = 1;