summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_time.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index cbf0c4e27f5..82a805cffd8 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.66 2009/06/05 15:17:02 ckuethe Exp $ */
+/* $OpenBSD: kern_time.c,v 1.67 2009/10/16 19:29:41 martynas Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -638,6 +638,10 @@ sys_setitimer(struct proc *p, void *v, register_t *retval)
itimerround(&aitv.it_interval);
s = splclock();
p->p_stats->p_timer[SCARG(uap, which)] = aitv;
+ if (SCARG(uap, which) == ITIMER_VIRTUAL)
+ timeout_del(&p->p_stats->p_virt_to);
+ if (SCARG(uap, which) == ITIMER_PROF)
+ timeout_del(&p->p_stats->p_prof_to);
splx(s);
}