summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1994-12-18 19:35:59 +0000
committerjoerg <joerg@FreeBSD.org>1994-12-18 19:35:59 +0000
commit0aa72cd711efe7097940f166e4937f76d5a8c1d7 (patch)
treeb4f3a4e4df2cc3976fd0cd9af5a61f4e446b2061
parent761d6c11bdaeaa61befd4a9481f13b314f0fa34f (diff)
downloadFreeBSD-src-0aa72cd711efe7097940f166e4937f76d5a8c1d7.zip
FreeBSD-src-0aa72cd711efe7097940f166e4937f76d5a8c1d7.tar.gz
Move the code providing the equivalent of ICRNL for console input from
the device driver(s) to cons.c.
-rw-r--r--sys/dev/syscons/syscons.c3
-rw-r--r--sys/i386/i386/cons.c7
-rw-r--r--sys/i386/isa/syscons.c3
-rw-r--r--sys/isa/syscons.c3
-rw-r--r--sys/kern/tty_cons.c7
5 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 2d0e3ca..78e1c61 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.80 1994/11/21 17:59:29 ache Exp $
+ * $Id: syscons.c,v 1.81 1994/12/06 19:32:00 sos Exp $
*/
#include "sc.h"
@@ -1229,7 +1229,6 @@ pccngetc(dev_t dev)
int s = spltty(); /* block scintr while we poll */
int c = scgetc(0);
splx(s);
- if (c == '\r') c = '\n';
return(c);
}
diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c
index 9ed6e62..1be20d2 100644
--- a/sys/i386/i386/cons.c
+++ b/sys/i386/i386/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.16 1994/10/20 00:07:45 phk Exp $
+ * $Id: cons.c,v 1.17 1994/10/31 17:20:14 joerg Exp $
*/
@@ -213,9 +213,12 @@ cnselect(dev, rw, p)
int
cngetc()
{
+ int c;
if (cn_tab == NULL)
return (0);
- return ((*cn_tab->cn_getc)(cn_tab->cn_dev));
+ c = (*cn_tab->cn_getc)(cn_tab->cn_dev);
+ if (c == '\r') c = '\n'; /* console input is always ICRNL */
+ return (c);
}
int
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c
index 2d0e3ca..78e1c61 100644
--- a/sys/i386/isa/syscons.c
+++ b/sys/i386/isa/syscons.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.80 1994/11/21 17:59:29 ache Exp $
+ * $Id: syscons.c,v 1.81 1994/12/06 19:32:00 sos Exp $
*/
#include "sc.h"
@@ -1229,7 +1229,6 @@ pccngetc(dev_t dev)
int s = spltty(); /* block scintr while we poll */
int c = scgetc(0);
splx(s);
- if (c == '\r') c = '\n';
return(c);
}
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index 2d0e3ca..78e1c61 100644
--- a/sys/isa/syscons.c
+++ b/sys/isa/syscons.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.80 1994/11/21 17:59:29 ache Exp $
+ * $Id: syscons.c,v 1.81 1994/12/06 19:32:00 sos Exp $
*/
#include "sc.h"
@@ -1229,7 +1229,6 @@ pccngetc(dev_t dev)
int s = spltty(); /* block scintr while we poll */
int c = scgetc(0);
splx(s);
- if (c == '\r') c = '\n';
return(c);
}
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 9ed6e62..1be20d2 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.16 1994/10/20 00:07:45 phk Exp $
+ * $Id: cons.c,v 1.17 1994/10/31 17:20:14 joerg Exp $
*/
@@ -213,9 +213,12 @@ cnselect(dev, rw, p)
int
cngetc()
{
+ int c;
if (cn_tab == NULL)
return (0);
- return ((*cn_tab->cn_getc)(cn_tab->cn_dev));
+ c = (*cn_tab->cn_getc)(cn_tab->cn_dev);
+ if (c == '\r') c = '\n'; /* console input is always ICRNL */
+ return (c);
}
int
OpenPOWER on IntegriCloud