summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1995-07-23 23:02:20 +0000
committermpp <mpp@FreeBSD.org>1995-07-23 23:02:20 +0000
commit09298b57cf9c36af196592c8eb0515929c3aa697 (patch)
treefad634e2225b1d9c4c6aa56e42467a08c495c7c7 /sys
parent3cd91f70c57bc0275934f24cd2274d4e66a0d189 (diff)
downloadFreeBSD-src-09298b57cf9c36af196592c8eb0515929c3aa697.zip
FreeBSD-src-09298b57cf9c36af196592c8eb0515929c3aa697.tar.gz
Use the same method to determine the time that the process
ended that fork() uses to determine the time that the process started when calculating the elapsed time. This prevents the ac_etime field in the accounting record from getting set to -1 if the process exists for a VERY short period of time.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_acct.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 46ed697..c6c2b42 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_acct.c 8.1 (Berkeley) 6/14/93
- * $Id: kern_acct.c,v 1.5 1994/09/26 21:09:00 davidg Exp $
+ * $Id: kern_acct.c,v 1.6 1994/10/02 17:35:09 phk Exp $
*/
#include <sys/param.h>
@@ -183,9 +183,7 @@ acct_process(p)
/* (3) The elapsed time the commmand ran (and its starting time) */
acct.ac_btime = p->p_stats->p_start.tv_sec;
- s = splclock();
- tmp = time;
- splx(s);
+ microtime(&tmp);
timevalsub(&tmp, &p->p_stats->p_start);
acct.ac_etime = encode_comp_t(tmp.tv_sec, tmp.tv_usec);
OpenPOWER on IntegriCloud