summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-02-15 02:34:15 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-02-15 02:34:15 +0000
commit4f1d2e86d20a13a10ecfc675fa5b46eaa90b3389 (patch)
treecdbefbb46f176a385e2918dedd45d38309432260 /sys/kern
parentee7a1b8a3ee367b5712040ea26f04652610a9a97 (diff)
pretty code that's easier to read, same effect.
from netbsd via Pedro Martelletto <pbastos@rdc.puc-rio.br>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c12
1 files changed, 8 insertions, 4 deletions
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))