Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2014 21:10:33 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266861 - head/sys/dev/vt
Message-ID:  <201405292110.s4TLAXFU020408@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu May 29 21:10:33 2014
New Revision: 266861
URL: http://svnweb.freebsd.org/changeset/base/266861

Log:
  Update size in vt_grow if we don't have to reallocate
  
  vt_grow may be called with a new size that's larger than previous but
  does not require reallocation - for example, when the number of columns
  is the same and new number of rows is less than the history size.
  Prior to this change we would fail to update vb_scr_size, and then hit
  a KASSERT when trying to write to the newly visible rows.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_buf.c

Modified: head/sys/dev/vt/vt_buf.c
==============================================================================
--- head/sys/dev/vt/vt_buf.c	Thu May 29 21:03:49 2014	(r266860)
+++ head/sys/dev/vt/vt_buf.c	Thu May 29 21:10:33 2014	(r266861)
@@ -496,6 +496,9 @@ vtbuf_grow(struct vt_buf *vb, const term
 		/* Deallocate old buffer. */
 		free(old, M_VTBUF);
 		free(oldrows, M_VTBUF);
+	} else {
+		/* Just update the size. */
+		vb->vb_scr_size = *p;
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405292110.s4TLAXFU020408>