From: Denys Vlasenko Date: Mon, 22 Aug 2016 18:56:58 +0000 (+0200) Subject: init: fix for FreeBSD console opening. Closes 9031 X-Git-Tag: 1_26_0~288 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d035528261eb9304e9e448c7d8847095b8e8c7c5;p=oweals%2Fbusybox.git init: fix for FreeBSD console opening. Closes 9031 Signed-off-by: Denys Vlasenko --- 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) s = getenv("CONSOLE"); if (!s) 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) { int fd = open(s, O_RDWR | O_NONBLOCK | O_NOCTTY); if (fd >= 0) {