summaryrefslogtreecommitdiff
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2008-05-22 17:05:00 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2008-05-22 17:05:00 +0000
commit7c592a9aed3ed2ced3fc174cf9d75bd443193b91 (patch)
tree0693b45049e38f3b4bbf94b6228f6dd15c3ec15d /sys/kern/kern_resource.c
parent06f95dcc1b4ae1bdde39826dadeea050324c1030 (diff)
Use LIST_FOREACH() instead of handrolling.
From: Pierre Riteau pierre.riteau_att_gmail.com OK miod@
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index f139dbd2f0a..f50d88b5263 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_resource.c,v 1.32 2007/04/12 22:14:15 tedu Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.33 2008/05/22 17:04:59 thib Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
@@ -100,7 +100,7 @@ sys_getpriority(struct proc *curp, void *v, register_t *retval)
case PRIO_USER:
if (SCARG(uap, who) == 0)
SCARG(uap, who) = curp->p_ucred->cr_uid;
- for (p = LIST_FIRST(&allproc); p; p = LIST_NEXT(p, p_list))
+ LIST_FOREACH(p, &allproc, p_list)
if (p->p_ucred->cr_uid == SCARG(uap, who) &&
p->p_nice < low)
low = p->p_nice;
@@ -157,7 +157,7 @@ sys_setpriority(struct proc *curp, void *v, register_t *retval)
case PRIO_USER:
if (SCARG(uap, who) == 0)
SCARG(uap, who) = curp->p_ucred->cr_uid;
- for (p = LIST_FIRST(&allproc); p; p = LIST_NEXT(p, p_list))
+ LIST_FOREACH(p, &allproc, p_list)
if (p->p_ucred->cr_uid == SCARG(uap, who)) {
error = donice(curp, p, SCARG(uap, prio));
found++;