Date: Wed, 29 Dec 2010 05:13:21 +0000 (UTC) From: Colin Percival <cperciva@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216790 - head/sys/dev/xen/console Message-ID: <201012290513.oBT5DLJN088227@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012290513.oBT5DLJN088227>