0001-pluto-Use-time_monotonic-instead-of-a-custom-impleme.patch

Tobias Brunner, 22.03.2012 14:12

Download (875 Bytes)

View differences:

src/pluto/timer.c
46 46
 */
47 47
time_t now(void)
48 48
{
49
	static time_t delta = 0
50
		, last_time = 0;
51
	time_t n = time(NULL);
52

  
53
	passert(n != (time_t)-1);
54
	if (last_time > n)
55
	{
56
		plog("time moved backwards %ld seconds", (long)(last_time - n));
57
		delta += last_time - n;
58
	}
59
	last_time = n;
60
	return n + delta;
49
	return time_monotonic(NULL);
61 50
}
62 51

  
63 52
/* This file has the event handling routines. Events are
64
-