put back nmaxproc check mistakely changed in rev.1.132

checking against nprocs is wrong in any case btw - we do allow
maxproc higher than number of current processes, it would just mean
no new process could be started until number of processes would
be lower than the new limit
This commit is contained in:
jdolecek 2003-03-27 18:34:18 +00:00
parent e950c1ac8f
commit 5fe02453b5
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sysctl.c,v 1.132 2003/03/19 11:36:32 dsl Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.133 2003/03/27 18:34:18 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.132 2003/03/19 11:36:32 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.133 2003/03/27 18:34:18 jdolecek Exp $");
#include "opt_ddb.h"
#include "opt_insecure.h"
@ -388,7 +388,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
error = sysctl_int(oldp, oldlenp, newp, newlen, &nmaxproc);
if (!error && newp) {
if (nmaxproc < nprocs)
if (nmaxproc < 0 || nmaxproc >= PID_MAX)
return (EINVAL);
#ifdef __HAVE_CPU_MAXPROC