From: bru Date: Tue, 2 Mar 2021 22:35:19 +0000 (+0000) Subject: Read general and touchpad-specific wsmouse settings separately. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8665dd6d59e7454d097b31bbe917b28105dec7ef;p=openbsd Read general and touchpad-specific wsmouse settings separately. Correct the identification of the device type when reading the touchpad parameters fails. ok jcs@ --- diff --git a/sbin/wsconsctl/mousecfg.c b/sbin/wsconsctl/mousecfg.c index 6d52bcbfc9c..afa98cfb1ce 100644 --- a/sbin/wsconsctl/mousecfg.c +++ b/sbin/wsconsctl/mousecfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mousecfg.c,v 1.7 2020/04/02 17:17:04 deraadt Exp $ */ +/* $OpenBSD: mousecfg.c,v 1.8 2021/03/02 22:35:19 bru Exp $ */ /* * Copyright (c) 2017 Ulf Brosziewski @@ -162,11 +162,17 @@ mousecfg_init(int dev_fd, const char **errstr) } parameters.params = cfg_buffer; - parameters.nparams = (cfg_touchpad ? BUFSIZE : BASESIZE); + parameters.nparams = BASESIZE; if ((err = ioctl(dev_fd, WSMOUSEIO_GETPARAMS, ¶meters))) { *errstr = "WSMOUSEIO_GETPARAMS"; return (err); } + if (cfg_touchpad) { + parameters.params = cfg_buffer + BASESIZE; + parameters.nparams = BUFSIZE - BASESIZE; + if (ioctl(dev_fd, WSMOUSEIO_GETPARAMS, ¶meters)) + cfg_touchpad = 0; + } return (0); }