svn commit: r217082 - releng/8.2/sys/dev/xen/console

Colin Percival cperciva at FreeBSD.org
Thu Jan 6 22:54:50 UTC 2011


Author: cperciva
Date: Thu Jan  6 22:54:48 2011
New Revision: 217082
URL: http://svn.freebsd.org/changeset/base/217082

Log:
  MFS r217053: Fix the Xen console to not spew \0 bytes when there is no
  input available.
  
  Approved by:	re (rwatson)

Modified:
  releng/8.2/sys/dev/xen/console/console.c
Directory Properties:
  releng/8.2/sys/   (props changed)
  releng/8.2/sys/amd64/include/xen/   (props changed)
  releng/8.2/sys/cddl/contrib/opensolaris/   (props changed)
  releng/8.2/sys/contrib/dev/acpica/   (props changed)
  releng/8.2/sys/contrib/pf/   (props changed)

Modified: releng/8.2/sys/dev/xen/console/console.c
==============================================================================
--- releng/8.2/sys/dev/xen/console/console.c	Thu Jan  6 22:53:55 2011	(r217081)
+++ releng/8.2/sys/dev/xen/console/console.c	Thu Jan  6 22:54:48 2011	(r217082)
@@ -145,17 +145,18 @@ xccngetc(struct consdev *dev)
 int
 xccncheckc(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);
 }


More information about the svn-src-all mailing list