Fix hangs caused by overzealous code removal.

Thanks, Nickolay, for figuring out this is the problem.

Submitted by:	Nickolay Dudorov <nnd@mail.nsk.ru>
This commit is contained in:
Brian Feldman 2000-08-31 11:31:58 +00:00
parent e2b41a622b
commit b6240737d5
2 changed files with 4 additions and 4 deletions

View File

@ -427,8 +427,8 @@ sbreserve(sb, cc, so, p)
*/
if ((u_quad_t)cc > (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES))
return (0);
if (p && !chgsbsize(so->so_cred->cr_uid, &sb->sb_hiwat, cc,
p->p_rlimit[RLIMIT_SBSIZE].rlim_cur)) {
if (!chgsbsize(so->so_cred->cr_uid, &sb->sb_hiwat, cc,
p ? p->p_rlimit[RLIMIT_SBSIZE].rlim_cur : RLIM_INFINITY)) {
return (0);
}
sb->sb_mbmax = min(cc * sb_efficiency, sb_max);

View File

@ -427,8 +427,8 @@ sbreserve(sb, cc, so, p)
*/
if ((u_quad_t)cc > (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES))
return (0);
if (p && !chgsbsize(so->so_cred->cr_uid, &sb->sb_hiwat, cc,
p->p_rlimit[RLIMIT_SBSIZE].rlim_cur)) {
if (!chgsbsize(so->so_cred->cr_uid, &sb->sb_hiwat, cc,
p ? p->p_rlimit[RLIMIT_SBSIZE].rlim_cur : RLIM_INFINITY)) {
return (0);
}
sb->sb_mbmax = min(cc * sb_efficiency, sb_max);