tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Detecting keypress on console



On Fri, 29 Mar 2019, Michael van Elst wrote:

On Fri, Mar 29, 2019 at 08:39:24AM +0800, Paul Goyette wrote:
Hmmm.  On my amd64 8.99.35 system, I get

# wsmuxctl -f /dev/wsmux1 -l
wskbd0
Segmentation fault (core dumped)

Someone added a WSMUX_BELL device but forgot to support it in wsmuxctl.

The devnames array in wsmuxctl needs to be extended. Please try:

Index: wsmuxctl.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/wsmuxctl/wsmuxctl.c,v
retrieving revision 1.12
diff -p -u -r1.12 wsmuxctl.c
--- wsmuxctl.c  3 Feb 2019 03:19:31 -0000       1.12
+++ wsmuxctl.c  29 Mar 2019 05:55:28 -0000
@@ -45,7 +45,7 @@ __dead static void usage(void);

static const char *ctlpath = "/dev/wsmuxctl";

-static const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux" };
+static const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux", "wsbell" };

static void
usage(void)

Yup - I can confirm that with this change the segfault no longer occurs!

Thanks for the quick info - and please go ahead and commit (with an
appropriate KNF avoidance of >80char lines).



+--------------------+--------------------------+-----------------------+
| Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:     |
| (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost     |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost   |
+--------------------+--------------------------+-----------------------+


Home | Main Index | Thread Index | Old Index