From owner-svn-src-all@FreeBSD.ORG Tue Oct 7 18:47:54 2014 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 9066DBED; Tue, 7 Oct 2014 18:47:54 +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 7BB3BD5E; Tue, 7 Oct 2014 18:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s97Ils5W046676; Tue, 7 Oct 2014 18:47:54 GMT (envelope-from ray@FreeBSD.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s97Ilsbj046675; Tue, 7 Oct 2014 18:47:54 GMT (envelope-from ray@FreeBSD.org) Message-Id: <201410071847.s97Ilsbj046675@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ray set sender to ray@FreeBSD.org using -f From: Aleksandr Rybalko Date: Tue, 7 Oct 2014 18:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272715 - head/sys/dev/vt 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.18-1 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: Tue, 07 Oct 2014 18:47:54 -0000 Author: ray Date: Tue Oct 7 18:47:53 2014 New Revision: 272715 URL: https://svnweb.freebsd.org/changeset/base/272715 Log: Allow vt(4) to disable terminal bell with `sysctl kern.vt.bell_enable=0`, similar as syscons(4) do. Submitted by: Tiwei Bie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Oct 7 18:22:05 2014 (r272714) +++ head/sys/dev/vt/vt_core.c Tue Oct 7 18:47:53 2014 (r272715) @@ -120,6 +120,7 @@ const struct terminal_class vt_termclass static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters"); VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); +VT_SYSCTL_INT(enable_bell, 1, "Enable bell"); VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); @@ -904,6 +905,9 @@ vtterm_bell(struct terminal *tm) struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; + if (!vt_enable_bell) + return; + if (vd->vd_flags & VDF_QUIET_BELL) return; @@ -915,6 +919,9 @@ vtterm_beep(struct terminal *tm, u_int p { u_int freq, period; + if (!vt_enable_bell) + return; + if ((param == 0) || ((param & 0xffff) == 0)) { vtterm_bell(tm); return;