diff options
author | cperciva <cperciva@FreeBSD.org> | 2010-12-29 05:13:21 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2010-12-29 05:13:21 +0000 |
commit | 83176a34645a1df8d5383963324f71a7b7c3a195 (patch) | |
tree | c2d336ad5a469f8d0c561c2e36311ff4e7edcd07 | |
parent | be4347d563ece6ea2a91db1d4377cdfd8abfd220 (diff) | |
download | FreeBSD-src-83176a34645a1df8d5383963324f71a7b7c3a195.zip FreeBSD-src-83176a34645a1df8d5383963324f71a7b7c3a195.tar.gz |
A lack of console input is not the same thing as a byte of \0 input.
Correctly return -1 from cngetc when no input is available to be read.
This fixes the '(CTRL-C to abort)' spam while dumping.
MFC after: 3 days
-rw-r--r-- | sys/dev/xen/console/console.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/xen/console/console.c b/sys/dev/xen/console/console.c index 8f765e2..d614082 100644 --- a/sys/dev/xen/console/console.c +++ b/sys/dev/xen/console/console.c @@ -125,17 +125,18 @@ xc_cnterm(struct consdev *cp) static int xc_cngetc(struct consdev *dev) { - int ret = (xc_mute ? 0 : -1); + int ret; if (xencons_has_input()) xencons_handle_input(NULL); CN_LOCK(cn_mtx); - if ((rp - rc)) { + if ((rp - rc) && !xc_mute) { /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; - } + } else + ret = -1; CN_UNLOCK(cn_mtx); return(ret); } |