svn commit: r216790 - head/sys/dev/xen/console

[ Available lists | Index of svn-src-head | Month of Dec 2010 | Week of 29 Dec 2010 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Colin Percival <cperciva@FreeBSD.org>
Date
29 Dec 2010 05:13:21
Subject
svn commit: r216790 - head/sys/dev/xen/console
Message-ID
201012290513.oBT5DLJN088227@svn.freebsd.org


[ Hide this part ]
Author: cperciva
Date: Wed Dec 29 05:13:21 2010
New Revision: 216790
URL: http://svn.freebsd.org/changeset/base/216790

Log:
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

Modified:
head/sys/dev/xen/console/console.c

Modified: head/sys/dev/xen/console/console.c
==============================================================================
--- head/sys/dev/xen/console/console.c Wed Dec 29 04:17:50 2010 (r216789)
+++ head/sys/dev/xen/console/console.c Wed Dec 29 05:13:21 2010 (r216790)
@@ -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);
}

Elapsed time: 0.128 seconds