Throw away input if CREAD is not set. POSIX requires no characters to be

received in this case even if the hardware doesn't have a CREAD bit.

Found by:	NIST-PCTS
This commit is contained in:
Bruce Evans 1996-11-30 15:03:05 +00:00
parent 9924e17950
commit 38e81cedcf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=20046
3 changed files with 9 additions and 6 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.149 1996/11/13 18:31:51 bde Exp $
* $Id: sio.c,v 1.150 1996/11/30 14:51:04 bde Exp $
*/
#include "opt_comconsole.h"
@ -1758,7 +1758,8 @@ siopoll()
enable_intr();
(*linesw[tp->t_line].l_start)(tp);
}
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
if (incc <= 0 || !(tp->t_state & TS_ISOPEN) ||
!(tp->t_cflag & CREAD))
continue;
/*
* Avoid the grotesquely inefficient lineswitch routine

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.149 1996/11/13 18:31:51 bde Exp $
* $Id: sio.c,v 1.150 1996/11/30 14:51:04 bde Exp $
*/
#include "opt_comconsole.h"
@ -1758,7 +1758,8 @@ siopoll()
enable_intr();
(*linesw[tp->t_line].l_start)(tp);
}
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
if (incc <= 0 || !(tp->t_state & TS_ISOPEN) ||
!(tp->t_cflag & CREAD))
continue;
/*
* Avoid the grotesquely inefficient lineswitch routine

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.149 1996/11/13 18:31:51 bde Exp $
* $Id: sio.c,v 1.150 1996/11/30 14:51:04 bde Exp $
*/
#include "opt_comconsole.h"
@ -1758,7 +1758,8 @@ siopoll()
enable_intr();
(*linesw[tp->t_line].l_start)(tp);
}
if (incc <= 0 || !(tp->t_state & TS_ISOPEN))
if (incc <= 0 || !(tp->t_state & TS_ISOPEN) ||
!(tp->t_cflag & CREAD))
continue;
/*
* Avoid the grotesquely inefficient lineswitch routine