Close the console fd after probing if it's a wscons, even it fails.

This avoids keeping an open file descriptor on machines
where /dev/console is not a wsdisplay device.
This commit is contained in:
matthieu
2021-06-30 08:50:48 +00:00
parent 3743b28b5b
commit cbb2480f27

View File

@@ -627,9 +627,9 @@ xf86OpenWScons(void)
/* strip number, assuming 0 */
p = strchr(vtprefix, '0');
*p = '\0';
close(fd);
fd = -1;
}
close(fd);
}
}
if (VTnum != -1) {