From: Dwight Engen Date: Mon, 31 Dec 2012 19:02:49 +0000 (-0500) Subject: fix open check (0 is a valid fd) X-Git-Tag: lxc-0.9.0.alpha3~1^2~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4415d5163c17d462def86566c33910772237e0ce;p=thirdparty%2Flxc.git fix open check (0 is a valid fd) Signed-off-by: Dwight Engen Acked-by: Stéphane Graber --- 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;