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:
tegge 2001-02-20 23:34:16 +00:00
parent 18947b6ce3
commit aaab6ad128

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;