aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2022-03-29 09:54:06 +0200
committerKenny Levinsen <kl@kl.wtf>2022-03-29 10:03:30 +0200
commit684dd619455011bc08c85ae4c1b39394268b5646 (patch)
tree4b6155107ec1980db6947d2f2f0260637ed970e1
parentd5539dead8f258390c90e27acdc9f60a0cc68f2a (diff)
terminal: Revert FreeBSD behavior in set_keyboard
4ad48cb305b3f847ab7d3c2d3f59c27007519c77 introduced support for NetBSD, which modified a number of our ifdefs. In that process, FreeBSD was accidentally excluded from an important code path that controls keyboard usage on the kernel console. Revert part of that change to restore FreeBSD behavior.
-rw-r--r--common/terminal.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/terminal.c b/common/terminal.c
index 183c9bd..fa220a2 100644
--- a/common/terminal.c
+++ b/common/terminal.c
@@ -244,13 +244,12 @@ int terminal_ack_acquire(int fd) {
int terminal_set_keyboard(int fd, bool enable) {
log_debugf("Setting KD keyboard state to %d", enable);
-#if defined(__linux__) || defined(__NetBSD__)
if (ioctl(fd, KDSKBMODE, enable ? K_ENABLE : K_DISABLE) == -1) {
log_errorf("Could not set KD keyboard mode to %s: %s",
enable ? "enabled" : "disabled", strerror(errno));
return -1;
}
-#elif defined(__FreeBSD__)
+#if defined(__FreeBSD__)
struct termios tios;
if (tcgetattr(fd, &tios) == -1) {
log_errorf("Could not set get terminal mode: %s", strerror(errno));