Fix lock leakage and late unlock.

Submitted by:	bde
This commit is contained in:
tanimura 2002-03-02 12:42:24 +00:00
parent 3dccea70af
commit af34f116bc
2 changed files with 4 additions and 3 deletions

View File

@ -780,14 +780,14 @@ ttioctl(tp, cmd, data, flag)
}
PROC_UNLOCK(p);
PGRP_LOCK(p->p_pgrp);
PGRPSESS_SUNLOCK();
pgsignal(p->p_pgrp, SIGTTOU, 1);
PGRP_UNLOCK(p->p_pgrp);
error = ttysleep(tp, &lbolt, TTOPRI | PCATCH, "ttybg1",
0);
if (error) {
PGRPSESS_SUNLOCK();
if (error)
return (error);
}
PGRPSESS_SLOCK();
PROC_LOCK(p);
}
PROC_UNLOCK(p);

View File

@ -245,6 +245,7 @@ again:
SIGISMEMBER(p->p_sigmask, SIGTTIN) ||
p->p_pgrp->pg_jobc == 0 || p->p_flag & P_PPWAIT) {
PROC_UNLOCK(p);
PGRPSESS_SUNLOCK();
return (EIO);
}
PROC_UNLOCK(p);