← Commit list

d03552826

Denys Vlasenko
Denys Vlasenko
2016-08-22
SUCCESS Duration: 270s

Subject

init: fix for FreeBSD console opening. Closes 9031

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

init/init.c+5 -0
@@ -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) {