Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2012 19:13:32 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233126 - head/sys/kern
Message-ID:  <201203181913.q2IJDWGU032254@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Sun Mar 18 19:13:32 2012
New Revision: 233126
URL: http://svn.freebsd.org/changeset/base/233126

Log:
  Cast wallclock.tv_sec to uint64_t to avoid overflow in the calculation.
  
  PR:		kern/161552
  Reviewed by:	trasz
  Tested by:	Nikos Vassiliadis
  MFC after:	1 week

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==============================================================================
--- head/sys/kern/kern_racct.c	Sun Mar 18 19:12:11 2012	(r233125)
+++ head/sys/kern/kern_racct.c	Sun Mar 18 19:13:32 2012	(r233126)
@@ -745,7 +745,8 @@ racctd(void)
 			mtx_lock(&racct_lock);
 			racct_set_locked(p, RACCT_CPU, runtime);
 			racct_set_locked(p, RACCT_WALLCLOCK,
-			    wallclock.tv_sec * 1000000 + wallclock.tv_usec);
+			    (uint64_t)wallclock.tv_sec * 1000000 +
+			    wallclock.tv_usec);
 			mtx_unlock(&racct_lock);
 			PROC_UNLOCK(p);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203181913.q2IJDWGU032254>