summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_compat.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-04-02 03:51:53 +0000
committerache <ache@FreeBSD.org>1995-04-02 03:51:53 +0000
commitc32d1c8a89499a999ccd73c15fa49cdfdcf80875 (patch)
tree1ec2e2bf9ddce8ff93f771544d3d1b427166ea2f /sys/kern/tty_compat.c
parent3c9467d883848c3723cd56c864bc23252ee61215 (diff)
downloadFreeBSD-src-c32d1c8a89499a999ccd73c15fa49cdfdcf80875.zip
FreeBSD-src-c32d1c8a89499a999ccd73c15fa49cdfdcf80875.tar.gz
Return EINVAL instead of setting wrong in/out speed
Fix declaration of cc arrays Remove static from compatspcodes, will needed in sio (later)
Diffstat (limited to 'sys/kern/tty_compat.c')
-rw-r--r--sys/kern/tty_compat.c18
1 files changed, 9 insertions, 9 deletions
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];
OpenPOWER on IntegriCloud