mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 23:19:00 +00:00
ttywait: check conditions again right after oproc
Obtained from: (I know, but can't say :-)
This commit is contained in:
parent
87fe4a3ae4
commit
61181d7df2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3619
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tty.c 8.8 (Berkeley) 1/21/94
|
||||
* $Id: tty.c,v 1.9 1994/10/06 21:06:34 davidg Exp $
|
||||
* $Id: tty.c,v 1.10 1994/10/08 22:33:39 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -980,10 +980,13 @@ ttywait(tp)
|
||||
(ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL))
|
||||
&& tp->t_oproc) {
|
||||
(*tp->t_oproc)(tp);
|
||||
SET(tp->t_state, TS_ASLEEP);
|
||||
error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0);
|
||||
if (error)
|
||||
break;
|
||||
if ((tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY)) &&
|
||||
(ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL))) {
|
||||
SET(tp->t_state, TS_ASLEEP);
|
||||
error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0);
|
||||
if (error)
|
||||
break;
|
||||
}
|
||||
}
|
||||
splx(s);
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user