If the pointer to the new itimerval is NULL in kern_setitimer(), just

read the old value via kern_getitimer().
This commit is contained in:
John Baldwin 2005-02-07 21:45:48 +00:00
parent a4a3daa6f1
commit 5e85ac176f

View File

@ -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))