Fix lock leakage and late unlock.
Submitted by: bde
This commit is contained in:
parent
3dccea70af
commit
af34f116bc
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user