From nobody Tue Feb 14 13:15:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGMCb3rMVz3rxFJ; Tue, 14 Feb 2023 13:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGMCb3LkWz3yDq; Tue, 14 Feb 2023 13:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RAa4I7a3tcfBbaVqKeQCO9E3+Kd/1eEPcYeqvsIcqa0=; b=tXFzSVDPcjfT7h2cJIgRzKTpksRBGkZbsLeh2Sel2zlOOtEQI2mQwjWXqaXblbhL8hz4H7 0ZZeJDELp/6LCMXmS2nYMl43Faxj14SMR+JxIhBTQhxYjzrLrfkR4qZmf8dDIMcKGHDNLv KG2bgMe6MqpTVzFEWqgJt4OvMRnFBLlBAXmPvPjcNLktzq0NZsCDKrX2zVlNk+SfNULFKd 50hy2KWRsur9hv2IOMKvaB7GwdqOmZpHh8M1S9FO6x8cD6AQ94aOY1DEQCVF0WfbFSZaTj edsOCT1P8TeExcHVxzieHu/3BRf/iCRyqRpfT2UuSRZgyRklEvUKTbaxJbQ0Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RAa4I7a3tcfBbaVqKeQCO9E3+Kd/1eEPcYeqvsIcqa0=; b=TyZs2xZydEqIhEgVeSxEQx9L3b+DHLYme7Ti19dyD9fTjICynwKuOmqwMcqudTucWHZtYq VocM36UqntwSnRWMqMbYBMpBArpuD8D7RsrmZlbBYStw8qey9/dU0TfsKMxwqTsUzbCTrA xlmImJbrvI5gzOFaoaRWZKnTrdb/L1fw9jN+NBhAI8FLRHehgnBIExwMm8PEpi6jwjuu7H sgPk34o/8PFQQaim0gfyzjmS4KG/Vnt3qjCOu04Gn0WXFF7af1XaMbNJzf1frV12GM+1Jz JlA72HBbfkrBCuPlJtjn9lleGAIYqVAgXUGCBA1ugo/ckr7VT/tk1MCXcVE3KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676380555; a=rsa-sha256; cv=none; b=yEx1JP/xIrsAHqqLtQgvb9u0UkkYbqyRjgNdv6B++U8/09lBREtOy3Y0FX6mygPT9Z/CmB cApmsgLA1+pImERmObGgg5wETuZxYNxL0LMl4oOYg+Xif+9XUPmkTFyZh5FwDSyBPBGaJc jixUw8H5IHh8RUDQ4SMzHLilcaVW6heNZ8DN+eDNM2lo0NaP+QxhAzpeVrjpTh+LrqTKRU 2QvJl+V2p3qzb3UUpeELfVo5byBPMenUZZpFE0MAdZhBsBOG5U7NkIaibv7sd5MN2bafXA 9233FzrXSpopUJZ7ssx2UjhfdEapP4BAELeN+fGYekJzIUx9WHk+B5bKsP017g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGMCb2NpFz10G3; Tue, 14 Feb 2023 13:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31EDFtZI044356; Tue, 14 Feb 2023 13:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EDFtSA044355; Tue, 14 Feb 2023 13:15:55 GMT (envelope-from git) Date: Tue, 14 Feb 2023 13:15:55 GMT Message-Id: <202302141315.31EDFtSA044355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: b4eab621f246 - main - kbdcontrol.c: make pre-Unicode compatibility conditional List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4eab621f2462574d1836c199dc84c5bdb4f60f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=b4eab621f2462574d1836c199dc84c5bdb4f60f7 commit b4eab621f2462574d1836c199dc84c5bdb4f60f7 Author: Stefan Eßer AuthorDate: 2023-02-14 12:27:27 +0000 Commit: Stefan Eßer CommitDate: 2023-02-14 12:27:27 +0000 kbdcontrol.c: make pre-Unicode compatibility conditional Support for the full range of Unicode character codes has been added to the main keymap back in 2009, with compatibility shims added in 2011 (to support an older kbdcontrol command on a new kernel during an upgrade from FreeBSD-8 to FreeBSD-9). Unicode support for accented characters that are reached via dead key combinations has been added just recently, again with compatibility shims to allow all combinations of old/new kernel and old/new kbdcontrol command to load and display the keymaps including the dead key table. (But full Unicode in the dead key table requires both a new kernel and kbdcontrol command.) This commit makes the compatibility shims depend on the respective compatibility ioctls (OGIO_KEYMAP, OPIO_KEYMAP, OGIO_DEADKEYMAP, and OPIO_DEADKEYMAP) being defined in sys/kbio.h. This is true for all of them in 13-STABLE, none in 12-STABLE (as of now), and will become optional due to a follow-up commit to sys/kbio.h in -CURRENT. This commit is the only part of review D38465 that should be merged back to 12-STABLE and 13-STABLE. MFC after: 1 month --- usr.sbin/kbdcontrol/kbdcontrol.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 725d62a7bfe6..44f34f9a4f3a 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -818,6 +818,7 @@ add_keymap_path(const char *path) STAILQ_INSERT_TAIL(&pathlist, pe, next); } +#ifdef OPIO_DEADKEYMAP static void to_old_accentmap(accentmap_t *from, oaccentmap_t *to) { @@ -832,13 +833,16 @@ to_old_accentmap(accentmap_t *from, oaccentmap_t *to) } } } +#endif /* OPIO_DEADKEYMAP */ static void load_keymap(char *opt, int dumponly) { keymap_t keymap; accentmap_t accentmap; +#ifdef OPIO_DEADKEYMAP oaccentmap_t oaccentmap; +#endif /* OPIO_DEADKEYMAP */ struct pathent *pe; FILE *file; int j; @@ -898,8 +902,11 @@ load_keymap(char *opt, int dumponly) } if ((accentmap.n_accs > 0) && (ioctl(0, PIO_DEADKEYMAP, &accentmap) < 0)) { +#ifdef OPIO_DEADKEYMAP to_old_accentmap(&accentmap, &oaccentmap); - if (ioctl(0, OPIO_DEADKEYMAP, &oaccentmap) < 0) { + if (ioctl(0, OPIO_DEADKEYMAP, &oaccentmap) < 0) +#endif /* OGIO_DEADKEYMAP */ + { warn("setting accentmap"); fclose(file); return; @@ -907,6 +914,7 @@ load_keymap(char *opt, int dumponly) } } +#ifdef OPIO_DEADKEYMAP static void to_new_accentmap(oaccentmap_t *from, accentmap_t *to) { @@ -921,21 +929,26 @@ to_new_accentmap(oaccentmap_t *from, accentmap_t *to) } } } +#endif /* OPIO_DEADKEYMAP */ static void print_keymap(void) { keymap_t keymap; accentmap_t accentmap; +#ifdef OGIO_DEADKEYMAP oaccentmap_t oaccentmap; +#endif /* OPIO_DEADKEYMAP */ int i; if (ioctl(0, GIO_KEYMAP, &keymap) < 0) err(1, "getting keymap"); if (ioctl(0, GIO_DEADKEYMAP, &accentmap) < 0) { +#ifdef OGIO_DEADKEYMAP if (ioctl(0, OGIO_DEADKEYMAP, &oaccentmap) == 0) to_new_accentmap(&oaccentmap, &accentmap); else +#endif /* OGIO_DEADKEYMAP */ memset(&accentmap, 0, sizeof(accentmap)); } printf(