Commit 4415d516 by Dwight Engen Committed by Stéphane Graber

fix open check (0 is a valid fd)

parent 7265dc43
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment