From owner-svn-src-all@FreeBSD.ORG Mon Apr 20 17:43:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2B0C146; Mon, 20 Apr 2015 17:43:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A15A77B0; Mon, 20 Apr 2015 17:43:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3KHhtNP089930; Mon, 20 Apr 2015 17:43:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3KHhtcZ089929; Mon, 20 Apr 2015 17:43:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201504201743.t3KHhtcZ089929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 20 Apr 2015 17:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281779 - head/usr.sbin/vidcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2015 17:43:55 -0000 Author: emaste Date: Mon Apr 20 17:43:55 2015 New Revision: 281779 URL: https://svnweb.freebsd.org/changeset/base/281779 Log: vidcontrol: skip invalid video modes returned by vt(4) vt(4) has a stub CONS_MODEINFO ioctl that does not provide any data but returns success. This needs to be fixed in the kernel, but address it in vidcontrol(1) as well in case it's run on an older kernel. Reviewed by: bde Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 20 17:43:36 2015 (r281778) +++ head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 20 17:43:55 2015 (r281779) @@ -1085,12 +1085,16 @@ show_mode_info(void) printf("---------------------------------------" "---------------------------------------\n"); + memset(&_info, 0, sizeof(_info)); for (mode = 0; mode <= M_VESA_MODE_MAX; ++mode) { _info.vi_mode = mode; if (ioctl(0, CONS_MODEINFO, &_info)) continue; if (_info.vi_mode != mode) continue; + if (_info.vi_width == 0 && _info.vi_height == 0 && + _info.vi_cwidth == 0 && _info.vi_cheight == 0) + continue; printf("%3d (0x%03x)", mode, mode); printf(" 0x%08x", _info.vi_flags);