summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2019-05-31 04:46:18 +0000
committervisa <visa@openbsd.org>2019-05-31 04:46:18 +0000
commitdd36ccd07cf22b99e18324a6e1efc9e854d519c1 (patch)
treeb9b7fa7a7ec98710ebee5845ea05cd95600b789a /sys/kern/kern_resource.c
parentfix ssh-keysign fd handling problem introduced in r1.304 caused by a typo (diff)
downloadwireguard-openbsd-dd36ccd07cf22b99e18324a6e1efc9e854d519c1.tar.xz
wireguard-openbsd-dd36ccd07cf22b99e18324a6e1efc9e854d519c1.zip
Rename struct plimit field p_refcnt to pl_refcnt to avoid confusion
with the fields of struct proc. Make pl_refcnt unsigned for upcoming atomic updating. OK deraadt@ guenther@
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index e80439fdb6b..ffe560d7e38 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_resource.c,v 1.59 2019/01/06 12:59:45 visa Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.60 2019/05/31 04:46:18 visa Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
@@ -236,7 +236,7 @@ dosetrlimit(struct proc *p, u_int which, struct rlimit *limp)
if (limp->rlim_max > alimp->rlim_max)
if ((error = suser(p)) != 0)
return (error);
- if (p->p_p->ps_limit->p_refcnt > 1) {
+ if (p->p_p->ps_limit->pl_refcnt > 1) {
struct plimit *l = p->p_p->ps_limit;
/* limcopy() can sleep, so copy before decrementing refcnt */
@@ -552,14 +552,14 @@ limcopy(struct plimit *lim)
newlim = pool_get(&plimit_pool, PR_WAITOK);
memcpy(newlim->pl_rlimit, lim->pl_rlimit,
sizeof(struct rlimit) * RLIM_NLIMITS);
- newlim->p_refcnt = 1;
+ newlim->pl_refcnt = 1;
return (newlim);
}
void
limfree(struct plimit *lim)
{
- if (--lim->p_refcnt > 0)
+ if (--lim->pl_refcnt > 0)
return;
pool_put(&plimit_pool, lim);
}