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.
This commit is contained in:
parent
8e0b58f90d
commit
60a8e809b2
1 changed files with 5 additions and 1 deletions
|
@ -63,7 +63,11 @@ int terminal_current_vt(int fd) {
|
||||||
log_errorf("could not retrieve VT state: %s", strerror(errno));
|
log_errorf("could not retrieve VT state: %s", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return vt;
|
if (vt < 1) {
|
||||||
|
log_errorf("invalid vt: %d", vt);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return vt - 1;
|
||||||
#else
|
#else
|
||||||
#error Unsupported platform
|
#error Unsupported platform
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue