summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/cx.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-28 00:21:11 +0000
committerpst <pst@FreeBSD.org>1995-02-28 00:21:11 +0000
commit9b98fb36dc05ba21e4898c983c58bc0eb8f669b4 (patch)
tree91c6a33544eb4628383ab7c05b8571d00b6f35d3 /sys/i386/isa/cx.c
parent2b514bef5110bbe670f032770ac8769b1f371b4c (diff)
downloadFreeBSD-src-9b98fb36dc05ba21e4898c983c58bc0eb8f669b4.zip
FreeBSD-src-9b98fb36dc05ba21e4898c983c58bc0eb8f669b4.tar.gz
Incorporate bde's code-review comments.
(a) bring back ttselect, now that we have xxxdevtotty() it isn't dangerous. (b) remove all of the wrappers that have been replaced by ttselect (c) fix formatting in syscons.c and definition in syscons.h (d) add cxdevtotty NOT DONE: (e) make pcvt work... it was already broken...when someone fixes pcvt to link properly, just rename get_pccons to xxxdevtotty and we're done
Diffstat (limited to 'sys/i386/isa/cx.c')
-rw-r--r--sys/i386/isa/cx.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index f7a53fe..2ee5df8 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -671,6 +671,19 @@ int cxparam (struct tty *tp, struct termios *t)
splx (s);
return (0);
}
+
+struct tty *cxdevtotty (dev_t dev)
+{
+ int unit = UNIT(dev);
+
+ if (unit == UNIT_CTL)
+ return (NULL);
+
+ if (unit > NCX*NCHAN)
+ return (NULL);
+
+ return (cxchan[unit]->ttyp);
+}
int cxselect (dev_t dev, int flag, struct proc *p)
{
@@ -678,7 +691,11 @@ int cxselect (dev_t dev, int flag, struct proc *p)
if (unit == UNIT_CTL)
return (0);
- return (ttyselect (cxchan[unit]->ttyp, flag, p));
+
+ if (unit > NCX*NCHAN)
+ return (ENXIO);
+
+ return (ttyselect(cxchan[unit]->ttyp, flag, p));
}
/*
OpenPOWER on IntegriCloud