]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix open check (0 is a valid fd)
authorDwight Engen <dwight.engen@oracle.com>
Mon, 31 Dec 2012 19:02:49 +0000 (14:02 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 2 Jan 2013 17:53:56 +0000 (12:53 -0500)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/console.c

index 73bec783341f9d6ddd0482391c0130761f4a16f6..c3f892bf9fe975b950942145a8e13a39e6c33aec 100644 (file)
@@ -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;