From 4f1d2e86d20a13a10ecfc675fa5b46eaa90b3389 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 15 Feb 2004 02:34:15 +0000 Subject: pretty code that's easier to read, same effect. from netbsd via Pedro Martelletto --- sys/kern/kern_time.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index ed00fbc3134..ab9f7f8de73 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.38 2003/09/01 18:06:03 henning Exp $ */ +/* $OpenBSD: kern_time.c,v 1.39 2004/02/15 02:34:14 tedu Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -472,6 +472,7 @@ sys_setitimer(p, v, retval) syscallarg(const struct itimerval *) itv; syscallarg(struct itimerval *) oitv; } */ *uap = v; + struct sys_getitimer_args getargs; struct itimerval aitv; register const struct itimerval *itvp; int s, error; @@ -483,9 +484,12 @@ sys_setitimer(p, v, retval) if (itvp && (error = copyin((void *)itvp, (void *)&aitv, sizeof(struct itimerval)))) return (error); - if ((SCARG(uap, itv) = SCARG(uap, oitv)) && - (error = sys_getitimer(p, uap, retval))) - return (error); + if (SCARG(uap, oitv) != NULL) { + SCARG(&getargs, which) = SCARG(uap, which); + SCARG(&getargs, itv) = SCARG(uap, oitv); + if ((error = sys_getitimer(p, &getargs, retval))) + return (error); + } if (itvp == 0) return (0); if (itimerfix(&aitv.it_value) || itimerfix(&aitv.it_interval)) -- cgit v1.2.3