mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
tweak workaround for kernel bug.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28669 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e1eae65cf7
commit
8e731e7976
1 changed files with 4 additions and 3 deletions
|
@ -300,8 +300,9 @@ GSTimeNow(void)
|
|||
/* This is a workaround for a bug on some SMP intel systems where the TSC
|
||||
* clock information from the processors gets out of sync and causes a
|
||||
* leap of 4398 seconds into the future for an instant, and then back.
|
||||
* If we detect a time jump back (or forwards by that sort of amount)
|
||||
* we refettch the system time.
|
||||
* If we detect a time jump back by more than the sort of small interval
|
||||
* that ntpd might do (or forwards by a very large amount) we refetch the
|
||||
* system time to make sure we don't have a temporary glitch.
|
||||
*/
|
||||
{
|
||||
static int old = 0;
|
||||
|
@ -315,7 +316,7 @@ GSTimeNow(void)
|
|||
int diff = tp.tv_sec - old;
|
||||
|
||||
old = tp.tv_sec;
|
||||
if (diff < 0 || diff > 3000)
|
||||
if (diff < -1 || diff > 3000)
|
||||
{
|
||||
time_t now = (time_t)tp.tv_sec;
|
||||
|
||||
|
|
Loading…
Reference in a new issue