kernel: use tk2ms() instead of TK2MS macro for process time conversion

this code isnt time critical and process TReal delta can become
very long, so use tk2ms() which is less prone to overflow.
This commit is contained in:
cinap_lenrek 2016-09-07 23:39:10 +02:00
parent 1848f4e946
commit bd3429304c
2 changed files with 2 additions and 4 deletions

View file

@ -509,8 +509,7 @@ consread(Chan *c, void *buf, long n, vlong off)
l = up->time[i];
if(i == TReal)
l = MACHP(0)->ticks - l;
l = TK2MS(l);
readnum(0, tmp+NUMSIZE*i, NUMSIZE, l, NUMSIZE);
readnum(0, tmp+NUMSIZE*i, NUMSIZE, tk2ms(l), NUMSIZE);
}
memmove(buf, tmp+k, n);
return n;

View file

@ -905,8 +905,7 @@ procread(Chan *c, void *va, long n, vlong off)
l = p->time[i];
if(i == TReal)
l = MACHP(0)->ticks - l;
l = TK2MS(l);
readnum(0, statbuf+j+NUMSIZE*i, NUMSIZE, l, NUMSIZE);
readnum(0, statbuf+j+NUMSIZE*i, NUMSIZE, tk2ms(l), NUMSIZE);
}
readnum(0, statbuf+j+NUMSIZE*6, NUMSIZE, procpagecount(p)*BY2PG/1024, NUMSIZE);