diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-20 10:54:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-20 10:54:37 +0000 |
commit | 04907080a333c499e3f024962c5d24a5be3fdfee (patch) | |
tree | 7f36d214ce363a3d0789f4131bf65862d91aa326 /sys/kern/kern_resource.c | |
parent | 1e818041a24e6002c9ec32181f7670b29bdc323b (diff) |
calcru() must calculate using u_quad_t to avoid overflows; netbsd pr#2496, brb@exp.com
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 27e8045f7cb..450cc79de50 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1,5 +1,5 @@ -/* $OpenBSD: kern_resource.c,v 1.3 1996/03/03 17:19:53 niklas Exp $ */ -/* $NetBSD: kern_resource.c,v 1.34 1996/02/09 18:59:44 christos Exp $ */ +/* $OpenBSD: kern_resource.c,v 1.4 1996/06/20 10:54:36 deraadt Exp $ */ +/* $NetBSD: kern_resource.c,v 1.34.4.1 1996/06/13 23:31:14 jtc Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -365,7 +365,7 @@ calcru(p, up, sp, ip) sec += tv.tv_sec - runtime.tv_sec; usec += tv.tv_usec - runtime.tv_usec; } - u = sec * 1000000 + usec; + u = (u_quad_t) sec * 1000000 + usec; st = (u * st) / tot; sp->tv_sec = st / 1000000; sp->tv_usec = st % 1000000; |