summaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2000-08-30 00:01:48 +0000
committerBrian Feldman <green@FreeBSD.org>2000-08-30 00:01:48 +0000
commit60ee22579dd76afe4d97f699fdf9ff9be9aa1b9a (patch)
treea78285e05cc4f4ecb2f1821e37abfb02dad3ae4b /sys/kern/kern_fork.c
parent0fe62d73188c642ab8c433a0a771c586ff2f71ac (diff)
Notes
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 488e24db59c5..309baa0d7a4e 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -183,7 +183,7 @@ fork1(p1, flags, procp)
struct proc *p2, *pptr;
uid_t uid;
struct proc *newproc;
- int count;
+ int ok;
static int pidchecked = 0;
struct forklist *ep;
@@ -245,9 +245,8 @@ fork1(p1, flags, procp)
* Increment the count of procs running with this uid. Don't allow
* a nonprivileged user to exceed their current limit.
*/
- count = chgproccnt(uid, 1);
- if (uid != 0 && count > p1->p_rlimit[RLIMIT_NPROC].rlim_cur) {
- (void)chgproccnt(uid, -1);
+ ok = chgproccnt(uid, 1, p1->p_rlimit[RLIMIT_NPROC].rlim_cur);
+ if (uid != 0 && !ok) {
/*
* Back out the process count
*/