diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-08-22 20:56:58 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-08-22 20:56:58 +0200 |
commit | d035528261eb9304e9e448c7d8847095b8e8c7c5 (patch) | |
tree | 5eb6d912502e7f8f3fcd82bda96fdf6dbc1991a7 | |
parent | 2cf9fa6e597d0706b66e0c01f02b486fd0c9f77d (diff) | |
download | busybox-w32-d035528261eb9304e9e448c7d8847095b8e8c7c5.tar.gz busybox-w32-d035528261eb9304e9e448c7d8847095b8e8c7c5.tar.bz2 busybox-w32-d035528261eb9304e9e448c7d8847095b8e8c7c5.zip |
init: fix for FreeBSD console opening. Closes 9031
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | init/init.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c index 6eb76b80e..0813d1b5f 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -297,6 +297,11 @@ static void console_init(void) | |||
297 | s = getenv("CONSOLE"); | 297 | s = getenv("CONSOLE"); |
298 | if (!s) | 298 | if (!s) |
299 | s = getenv("console"); | 299 | s = getenv("console"); |
300 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | ||
301 | /* BSD people say their kernels do not open fd 0,1,2; they need this: */ | ||
302 | if (!s) | ||
303 | s = (char*)"/dev/console"; | ||
304 | #endif | ||
300 | if (s) { | 305 | if (s) { |
301 | int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); | 306 | int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); |
302 | if (fd >= 0) { | 307 | if (fd >= 0) { |