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

This commit is contained in:
Rob Bradford 2013-07-26 16:29:37 +01:00 committed by Kristian Høgsberg
parent 12a2ff3482
commit 5c89710166

View File

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