Date: Wed, 8 Oct 2014 10:43:39 +0800 From: Tiwei Bie <btw@mail.ustc.edu.cn> To: ray@ddteam.net Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] hw.syscons.bell sysctl for vt (newcons) Message-ID: <1412736219-32730-1-git-send-email-btw@mail.ustc.edu.cn>
next in thread | raw e-mail | index | archive | help
On 2014-10-08 02:48:36 (Wednesday), Aleksandr Rybalko <ray@ddteam.net> wrote: > On Sun, 5 Oct 2014 12:27:53 +0800 > Tiwei Bie <btw@mail.ustc.edu.cn> wrote: > > > Hi All, > > > > I think the hw.syscons.bell sysctl provided by syscons is a very convenient method > > to disable the sound alert in FreeBSD. But I haven't found the similar interface > > in vt. So I have written a patch to implement the sysctl 'kern.vt.enable_bell' > > which is similar to 'hw.syscons.bell' for vt. > > Hello Tiwei! > > Commited in r272715. > > Thanks a lot! > It's my pleasure! ;-) Tiwei Bie > > > > --- > > sys/dev/vt/vt_core.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c > > index 2dd7e3f..a8cdedb 100644 > > --- a/sys/dev/vt/vt_core.c > > +++ b/sys/dev/vt/vt_core.c > > @@ -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 param) > > { > > u_int freq, period; > > > > + if (!vt_enable_bell) > > + return; > > + > > if ((param == 0) || ((param & 0xffff) == 0)) { > > vtterm_bell(tm); > > return; > > -- > > 2.1.0 > > > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > -- > Aleksandr Rybalko <ray@ddteam.net> > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1412736219-32730-1-git-send-email-btw>