From c32d1c8a89499a999ccd73c15fa49cdfdcf80875 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 2 Apr 1995 03:51:53 +0000 Subject: Return EINVAL instead of setting wrong in/out speed Fix declaration of cc arrays Remove static from compatspcodes, will needed in sio (later) --- sys/kern/tty_compat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sys/kern/tty_compat.c') diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index 0a2e48c..7c85615 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_compat.c 8.1 (Berkeley) 6/10/93 - * $Id: tty_compat.c,v 1.7 1994/10/11 20:29:42 ache Exp $ + * $Id: tty_compat.c,v 1.8 1995/03/29 19:50:58 ache Exp $ */ /* @@ -78,7 +78,7 @@ static struct speedtab compatspeeds[] = { { 0, 0 }, { -1, -1 }, }; -static int compatspcodes[] = { +int compatspcodes[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, }; @@ -95,7 +95,7 @@ ttcompat(tp, com, data, flag) switch (com) { case TIOCGETP: { register struct sgttyb *sg = (struct sgttyb *)data; - register u_char *cc = tp->t_cc; + register cc_t *cc = tp->t_cc; register speed; speed = ttspeedtab(tp->t_ospeed, compatspeeds); @@ -120,11 +120,11 @@ ttcompat(tp, com, data, flag) term = tp->t_termios; if ((speed = sg->sg_ispeed) > MAX_SPEED || speed < 0) - term.c_ispeed = speed; + return(EINVAL); else term.c_ispeed = compatspcodes[speed]; if ((speed = sg->sg_ospeed) > MAX_SPEED || speed < 0) - term.c_ospeed = speed; + return(EINVAL); else term.c_ospeed = compatspcodes[speed]; term.c_cc[VERASE] = sg->sg_erase; @@ -137,7 +137,7 @@ ttcompat(tp, com, data, flag) case TIOCGETC: { struct tchars *tc = (struct tchars *)data; - register u_char *cc = tp->t_cc; + register cc_t *cc = tp->t_cc; tc->t_intrc = cc[VINTR]; tc->t_quitc = cc[VQUIT]; @@ -149,7 +149,7 @@ ttcompat(tp, com, data, flag) } case TIOCSETC: { struct tchars *tc = (struct tchars *)data; - register u_char *cc = tp->t_cc; + register cc_t *cc = tp->t_cc; cc[VINTR] = tc->t_intrc; cc[VQUIT] = tc->t_quitc; @@ -163,7 +163,7 @@ ttcompat(tp, com, data, flag) } case TIOCSLTC: { struct ltchars *ltc = (struct ltchars *)data; - register u_char *cc = tp->t_cc; + register cc_t *cc = tp->t_cc; cc[VSUSP] = ltc->t_suspc; cc[VDSUSP] = ltc->t_dsuspc; @@ -175,7 +175,7 @@ ttcompat(tp, com, data, flag) } case TIOCGLTC: { struct ltchars *ltc = (struct ltchars *)data; - register u_char *cc = tp->t_cc; + register cc_t *cc = tp->t_cc; ltc->t_suspc = cc[VSUSP]; ltc->t_dsuspc = cc[VDSUSP]; -- cgit v1.1