fix tty_destroy

fixes segfault when active tty could not be opened
fixes copy-paste mistake.
dev
Tim Wiederhake 14 years ago committed by Kristian Høgsberg
parent 238515d3d7
commit 70af98c576
  1. 8
      compositor/tty.c

@ -148,12 +148,12 @@ tty_create(struct wlsc_compositor *compositor)
void
tty_destroy(struct tty *tty)
{
int ret;
if(!tty)
return;
ret = ioctl(tty->fd, KDSETMODE, KD_TEXT);
if (ret)
if (ioctl(tty->fd, KDSETMODE, KD_TEXT))
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)
fprintf(stderr,

Loading…
Cancel
Save