From 4415d5163c17d462def86566c33910772237e0ce Mon Sep 17 00:00:00 2001 From: Dwight Engen Date: Mon, 31 Dec 2012 14:02:49 -0500 Subject: [PATCH] fix open check (0 is a valid fd) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Dwight Engen Acked-by: Stéphane Graber --- src/lxc/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/console.c b/src/lxc/console.c index 73bec7833..c3f892bf9 100644 --- a/src/lxc/console.c +++ b/src/lxc/console.c @@ -145,7 +145,7 @@ static int get_default_console(char **console) if (!access("/dev/tty", F_OK)) { fd = open("/dev/tty", O_RDWR); - if (fd > 0) { + if (fd >= 0) { close(fd); *console = strdup("/dev/tty"); goto out; -- 2.47.2