From 5e85ac176f42b50a6ce833ac281416850a9f93f7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 7 Feb 2005 21:45:48 +0000 Subject: [PATCH] If the pointer to the new itimerval is NULL in kern_setitimer(), just read the old value via kern_getitimer(). --- sys/kern/kern_time.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 76572b6f008a..a71e995b0522 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -516,6 +516,9 @@ kern_setitimer(struct thread *td, u_int which, struct itimerval *aitv, struct proc *p = td->td_proc; struct timeval ctv; + if (aitv == NULL) + return (kern_getitimer(td, which, oitv)); + if (which > ITIMER_PROF) return (EINVAL); if (itimerfix(&aitv->it_value))