-/* $OpenBSD: kern_resource.c,v 1.91 2024/10/08 11:57:59 claudio Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.92 2024/10/15 12:26:53 claudio Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
{
struct schedstate_percpu *spc = &curcpu()->ci_schedstate;
struct proc *p = curproc;
- struct timespec ts;
+ struct timespec ts, delta;
/*
* Compute the amount of time during which the current
(long long)spc->spc_runtime.tv_sec,
spc->spc_runtime.tv_nsec);
#endif
- timespecclear(&ts);
+ timespecclear(&delta);
} else {
- timespecsub(&ts, &spc->spc_runtime, &ts);
+ timespecsub(&ts, &spc->spc_runtime, &delta);
}
/* update spc_runtime */
spc->spc_runtime = ts;
tu_enter(&p->p_tu);
- timespecadd(&p->p_tu.tu_runtime, &ts, &p->p_tu.tu_runtime);
+ timespecadd(&p->p_tu.tu_runtime, &delta, &p->p_tu.tu_runtime);
tu_leave(&p->p_tu);
}