From 885d41dd7b87c41cb618140d50dd23501b6d4279 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 22 Jan 2017 21:08:28 +0100 Subject: sgi: get rid of timerset(0) case --- sys/src/9/sgi/clock.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/src/9/sgi/clock.c b/sys/src/9/sgi/clock.c index 0355e66f5..c7a0da440 100644 --- a/sys/src/9/sgi/clock.c +++ b/sys/src/9/sgi/clock.c @@ -148,14 +148,10 @@ timerset(Tval next) { long period; - if(next == 0) + period = next - fastticks(nil); + if(period < m->minperiod) + period = m->minperiod; + else if(period > m->maxperiod - m->minperiod) period = m->maxperiod; - else { - period = next - fastticks(nil); - if(period > m->maxperiod) - period = m->maxperiod; - else if(period < m->minperiod) - period = m->minperiod; - } wrcompare(rdcount()+period); } -- cgit v1.2.3