tty: Correctly check if the opening of the file descriptor failed
This commit is contained in:
parent
12a2ff3482
commit
5c89710166
@ -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…
Reference in New Issue
Block a user