Ensure that RLIMIT_NPROC limits are at least 1 to avoid bad interaction

with chgproccnt.  MFC candiate.

Reviewed by:	alfred
This commit is contained in:
Tor Egge 2001-02-20 23:34:16 +00:00
parent 58e9b41722
commit d82b3e319a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72780

View file

@ -506,6 +506,10 @@ dosetrlimit(p, which, limp)
limp->rlim_cur = maxprocperuid;
if (limp->rlim_max > maxprocperuid)
limp->rlim_max = maxprocperuid;
if (limp->rlim_cur < 1)
limp->rlim_cur = 1;
if (limp->rlim_max < 1)
limp->rlim_max = 1;
break;
}
*alimp = *limp;