terminal: Revert FreeBSD behavior in set_keyboard

4ad48cb305 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.
This commit is contained in:
Kenny Levinsen 2022-03-29 09:54:06 +02:00
parent d5539dead8
commit 684dd61945

View file

@ -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));