tty: Correctly check if the opening of the file descriptor failed

dev
Rob Bradford 12 years ago committed by Kristian Høgsberg
parent 12a2ff3482
commit 5c89710166
  1. 2
      src/tty.c

@ -161,7 +161,7 @@ tty_create(struct weston_compositor *compositor, tty_vt_func_t vt_func,
tty->fd = try_open_vt(tty); tty->fd = try_open_vt(tty);
} }
if (tty->fd <= 0) { if (tty->fd < 0) {
weston_log("failed to open tty: %m\n"); weston_log("failed to open tty: %m\n");
free(tty); free(tty);
return NULL; return NULL;

Loading…
Cancel
Save