From nobody Mon Apr 10 21:32:41 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 4PwMdQ30vVz44qDs; Mon, 10 Apr 2023 21:32:42 +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 4PwMdP3Nrdz4fbS; Mon, 10 Apr 2023 21:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681162361; 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=NC3iOn5vITYhAtUja2oI7uHe0Zabx7y/zsRRx4ogp3o=; b=WJW/D70xYqeFlgQlGeCs2LGYy3lZIvlqBYqLK7WehxQbO4Zf75ChgFkbjEG3RfHYwogAFh T1J2OuyWqPgmP4bLIF3+NE8R3o/vcsQLrIwIoJxt3JW+5HHKbWkXJczG9IVbIyYXIVCrRd gygNXPGegA0MMEQ7TO5G4x0mKc6Ns5RfQ7SVUR8DDp+l4eir18ieqtVatQryrOo4hAWVkb YfbkaR6aXnAuR+Qv43iNDhcmChETz1dhBdfGINP9eMTM6oLaSbrhNzRJrPC2GhN6S6Dny1 eswrbBSpw0NYRLeoOjOynNciGTutzABuK0HbItCdqLF4nyiF0/TQKh7R7KyUyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681162361; 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=NC3iOn5vITYhAtUja2oI7uHe0Zabx7y/zsRRx4ogp3o=; b=B4Ufu6k6vhAuyMclZDcKZrZVYc6uH8HjTVDIwJEXEViqHiEHaiLJs25eLmWz4p/yQ/LYKw qBA3zm38rCjBforVYmhfa1e4Z5oNDfQ2bD+0nExhmFpyu7myBx9cwhGi4XVzUycbO9BwmY Bqxg4wK5LSQzGZJOIMJ2EKttnkRcWxPeQMX5M/D4tuwhUttqDhD6bKKbywPxyQsgbAwtDs OqTzlIwp0LpPg3ubGjf+N+IhCFGp/qqR1n1FFJcV2IAyu0yveaG92RenULnH1CCb2Soh9I coaMQmpOWEIvzml1s9YThUxM26HQ4tLeIWZzaniPbpOh3OpNII6vcYmOwUQhxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681162361; a=rsa-sha256; cv=none; b=u0UsWtB3d8wI+ShI9FAj5NyH+vDxF3bTZNxFcgvumj62s2l39Z6nfrPWagpZN2kFWFglGJ pDkZMeULgOLfvixW9gOy6PRf0GmOYqaJW5yf7aVJn0kk0pbnFJZJoGeZQSAl55H2kRkLx7 2yDZBzZRc/8H6YBzlcUGQ7vBkvkl09mILPkc77a5NpLQPH+eDuhXuvcmNEY4JHLvqWcg5l FlVpZmkoO24HwZ4/Qv2jBwEx+IKMR4Tmr7IoWJ6T48wzFAGVyPiinzw6LR89CP0/CJ0yoZ lGUd6w9XZ3dU4k9v4YXFDIy6pSa93SDTcALP1BvWBycEg6Iw+KXQAETdoS/PmA== 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 4PwMdP12yTz16Kt; Mon, 10 Apr 2023 21:32:41 +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 33ALWfHK051848; Mon, 10 Apr 2023 21:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33ALWflP051847; Mon, 10 Apr 2023 21:32:41 GMT (envelope-from git) Date: Mon, 10 Apr 2023 21:32:41 GMT Message-Id: <202304102132.33ALWflP051847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 1412836cbd5b - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1412836cbd5bd9e6e828bb6e4dedb51aaa1c512c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=1412836cbd5bd9e6e828bb6e4dedb51aaa1c512c commit 1412836cbd5bd9e6e828bb6e4dedb51aaa1c512c Author: Stefan Eßer AuthorDate: 2023-02-14 12:27:27 +0000 Commit: Stefan Eßer CommitDate: 2023-04-10 21:31:24 +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. (cherry picked from commit b4eab621f2462574d1836c199dc84c5bdb4f60f7) --- 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(