Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/dev Have prom_cngetc() wait until input has...



details:   https://anonhg.NetBSD.org/src/rev/0fb1eca7abe5
branches:  trunk
changeset: 485113:0fb1eca7abe5
user:      pk <pk%NetBSD.org@localhost>
date:      Wed Apr 19 08:15:06 2000 +0000

description:
Have prom_cngetc() wait until input has been typed.

diffstat:

 sys/arch/sparc64/dev/consinit.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 5bf36c22ac46 -r 0fb1eca7abe5 sys/arch/sparc64/dev/consinit.c
--- a/sys/arch/sparc64/dev/consinit.c   Wed Apr 19 07:57:50 2000 +0000
+++ b/sys/arch/sparc64/dev/consinit.c   Wed Apr 19 08:15:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consinit.c,v 1.3 2000/04/13 09:54:43 mrg Exp $ */
+/*     $NetBSD: consinit.c,v 1.4 2000/04/19 08:15:06 pk Exp $  */
 
 /*-
  * Copyright (c) 1999 Eduardo E. Horvath
@@ -118,15 +118,18 @@
 prom_cngetc(dev)
        dev_t dev;
 {
-       char c0;
+       char c;
 
        if (!stdin) {
                int node = OF_finddevice("/chosen");
                OF_getprop(node, "stdin",  &stdin, sizeof(stdin));
        }
-       if (OF_read(stdin, &c0, 1) == 1)
-               return (c0);
-       return -1;
+       while (OF_read(stdin, &c, 1) != 1)
+               /*void*/;
+
+       if (c == '\r')
+               c = '\n';
+       return (c);
 }
 
 /*



Home | Main Index | Thread Index | Old Index