Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Fix strange kernel output sequence "\n\r" observed i...



details:   https://anonhg.NetBSD.org/src/rev/c27a392f0e0b
branches:  trunk
changeset: 336542:c27a392f0e0b
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Thu Mar 05 14:02:55 2015 +0000

description:
Fix strange kernel output sequence "\n\r" observed in serial
consoles.  Output '\r' before '\n' in conversion.

diffstat:

 sys/dev/cons.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 75a7624c4f25 -r c27a392f0e0b sys/dev/cons.c
--- a/sys/dev/cons.c    Thu Mar 05 10:22:25 2015 +0000
+++ b/sys/dev/cons.c    Thu Mar 05 14:02:55 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cons.c,v 1.73 2015/02/23 06:54:12 mlelstv Exp $        */
+/*     $NetBSD: cons.c,v 1.74 2015/03/05 14:02:55 nakayama Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.73 2015/02/23 06:54:12 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.74 2015/03/05 14:02:55 nakayama Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -322,11 +322,11 @@
                return;
 
        if (c) {
-               (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
                if (c == '\n') {
+                       (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
                        docritpollhooks();
-                       (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
                }
+               (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
        }
 }
 



Home | Main Index | Thread Index | Old Index