From: Lionel Sambuc Date: Fri, 23 Aug 2013 18:27:27 +0000 (+0200) Subject: Adapt the type used for adjtime_delta X-Git-Tag: v3.3.0~637 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/index.css?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F921%2F2;p=minix.git Adapt the type used for adjtime_delta clock_t is currently a signed type, but in NetBSD this is not the case. As we plan on aligning our types we have to change this as this prevents negative delta from being correctly used. Change-Id: I9bccdee2b41626b0262471dc1900de505a1991a7 --- diff --git a/kernel/clock.c b/kernel/clock.c index be6cfa572..c371e4dc8 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -67,7 +67,7 @@ static clock_t realtime = 0; /* Number of ticks to adjust realtime by. A negative value implies slowing * down realtime, a positive value implies speeding it up. */ -static clock_t adjtime_delta = 0; +static int32_t adjtime_delta = 0; /* * The boot processor's timer interrupt handler. In addition to non-boot cpus @@ -195,7 +195,7 @@ void set_realtime(clock_t newrealtime) /*===========================================================================* * set_adjtime_delta * *===========================================================================*/ -void set_adjtime_delta(clock_t ticks) +void set_adjtime_delta(int32_t ticks) { adjtime_delta = ticks; } diff --git a/kernel/proto.h b/kernel/proto.h index e59c54d6c..9ac2fd483 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -16,7 +16,7 @@ struct timer; /* clock.c */ clock_t get_realtime(void); void set_realtime(clock_t); -void set_adjtime_delta(clock_t); +void set_adjtime_delta(int32_t); clock_t get_monotonic(void); void set_timer(struct timer *tp, clock_t t, tmr_func_t f); void reset_timer(struct timer *tp); diff --git a/kernel/system/do_settime.c b/kernel/system/do_settime.c index b9116331a..c28b45e56 100644 --- a/kernel/system/do_settime.c +++ b/kernel/system/do_settime.c @@ -17,7 +17,8 @@ *===========================================================================*/ int do_settime(struct proc * caller, message * m_ptr) { - clock_t newclock, ticks; + clock_t newclock; + int32_t ticks; time_t timediff; signed long long timediff_ticks;