mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-18 06:59:46 -05:00
fix tty_destroy
fixes segfault when active tty could not be opened fixes copy-paste mistake.
This commit is contained in:
parent
238515d3d7
commit
70af98c576
1 changed files with 4 additions and 4 deletions
|
|
@ -148,12 +148,12 @@ tty_create(struct wlsc_compositor *compositor)
|
||||||
void
|
void
|
||||||
tty_destroy(struct tty *tty)
|
tty_destroy(struct tty *tty)
|
||||||
{
|
{
|
||||||
int ret;
|
if(!tty)
|
||||||
|
return;
|
||||||
|
|
||||||
ret = ioctl(tty->fd, KDSETMODE, KD_TEXT);
|
if (ioctl(tty->fd, KDSETMODE, KD_TEXT))
|
||||||
if (ret)
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"failed to set KD_GRAPHICS mode on tty: %m\n");
|
"failed to set KD_TEXT mode on tty: %m\n");
|
||||||
|
|
||||||
if (tcsetattr(tty->fd, TCSANOW, &tty->terminal_attributes) < 0)
|
if (tcsetattr(tty->fd, TCSANOW, &tty->terminal_attributes) < 0)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue