init: fix for FreeBSD console opening. Closes 9031
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
2cf9fa6e59
commit
d035528261
@ -297,6 +297,11 @@ static void console_init(void)
|
|||||||
s = getenv("CONSOLE");
|
s = getenv("CONSOLE");
|
||||||
if (!s)
|
if (!s)
|
||||||
s = getenv("console");
|
s = getenv("console");
|
||||||
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
/* BSD people say their kernels do not open fd 0,1,2; they need this: */
|
||||||
|
if (!s)
|
||||||
|
s = (char*)"/dev/console";
|
||||||
|
#endif
|
||||||
if (s) {
|
if (s) {
|
||||||
int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY);
|
int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user