diff options
| author | Neel Natu <neel@FreeBSD.org> | 2010-01-26 03:42:34 +0000 |
|---|---|---|
| committer | Neel Natu <neel@FreeBSD.org> | 2010-01-26 03:42:34 +0000 |
| commit | 61f7c762de49f71e479b9d7c019f331f6b39d06c (patch) | |
| tree | ae02fdd056bf4a2b7c3540d7b561414935a6aef8 | |
| parent | d87b96dd843b016d1d3db1171c2df02e12333ce5 (diff) | |
Notes
| -rw-r--r-- | sys/dev/cfe/cfe_console.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/cfe/cfe_console.c b/sys/dev/cfe/cfe_console.c index 2c38096859f2..1461ef21119f 100644 --- a/sys/dev/cfe/cfe_console.c +++ b/sys/dev/cfe/cfe_console.c @@ -84,14 +84,12 @@ CONSOLE_DRIVER(cfe); static void cn_drvinit(void *unused) { - char output[32]; struct tty *tp; if (cfe_consdev.cn_pri != CN_DEAD && cfe_consdev.cn_name[0] != '\0') { tp = tty_alloc(&cfe_ttydevsw, NULL); - tty_makedev(tp, NULL, "%s", output); - tty_makealias(tp, "cfecons"); + tty_makedev(tp, NULL, "cfecons"); } } @@ -117,15 +115,21 @@ cfe_tty_close(struct tty *tp) static void cfe_tty_outwakeup(struct tty *tp) { - int len; + int len, written, rc; u_char buf[CFEBURSTLEN]; for (;;) { len = ttydisc_getc(tp, buf, sizeof buf); if (len == 0) break; - while (cfe_write(conhandle, buf, len) == 0) - continue; + + written = 0; + while (written < len) { + rc = cfe_write(conhandle, &buf[written], len - written); + if (rc < 0) + break; + written += rc; + } } } @@ -184,13 +188,9 @@ cfe_cnterm(struct consdev *cp) static int cfe_cngetc(struct consdev *cp) { - int result; unsigned char ch; - while ((result = cfe_read(conhandle, &ch, 1)) == 0) - continue; - - if (result > 0) { + if (cfe_read(conhandle, &ch, 1) == 1) { #if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) int kdb_brk; |
