From 5c89710166c637ed1fe51fccbcdd78639f21f749 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 26 Jul 2013 16:29:37 +0100 Subject: [PATCH] tty: Correctly check if the opening of the file descriptor failed --- src/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tty.c b/src/tty.c index 2324f6c3..38079a48 100644 --- a/src/tty.c +++ b/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); } - if (tty->fd <= 0) { + if (tty->fd < 0) { weston_log("failed to open tty: %m\n"); free(tty); return NULL;