diff options
author | Kenny Levinsen <kl@kl.wtf> | 2020-08-28 00:46:58 +0000 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2020-08-28 02:54:14 +0200 |
commit | 60a8e809b23fab0d77fb21c6336ef7f37c45640c (patch) | |
tree | c31d2545176ddf0d0cc70c68500930532dfc3e2e /common | |
parent | 8e0b58f90d5c1e325a7f3a1417ffdc2729bb29d5 (diff) | |
download | seatd-60a8e809b23fab0d77fb21c6336ef7f37c45640c.tar.xz |
terminal: FreeBSD VT num is 1 higher than tty num
This was causing all VT and TTY changes to be applied to the wrong TTY.
Diffstat (limited to 'common')
-rw-r--r-- | common/terminal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/terminal.c b/common/terminal.c index 126641d..77e9235 100644 --- a/common/terminal.c +++ b/common/terminal.c @@ -63,7 +63,11 @@ int terminal_current_vt(int fd) { log_errorf("could not retrieve VT state: %s", strerror(errno)); return -1; } - return vt; + if (vt < 1) { + log_errorf("invalid vt: %d", vt); + return -1; + } + return vt - 1; #else #error Unsupported platform #endif |