diff --git a/src/bootlogd.c b/src/bootlogd.c index 856fbac..e64bffb 100644 --- a/src/bootlogd.c +++ b/src/bootlogd.c @@ -489,6 +489,9 @@ int main(int argc, char **argv) int realfd; int n, m, i; int todo; +#ifndef __linux__ /* BSD-style ioctl needs an argument. */ + int on = 1; +#endif fp = NULL; logfile = LOGFILE; @@ -561,15 +564,20 @@ int main(int argc, char **argv) return 1; } +#ifdef __linux__ (void)ioctl(0, TIOCCONS, NULL); -#if 1 /* Work around bug in 2.1/2.2 kernels. Fixed in 2.2.13 and 2.3.18 */ if ((n = open("/dev/tty0", O_RDWR)) >= 0) { (void)ioctl(n, TIOCCONS, NULL); close(n); } #endif - if (ioctl(pts, TIOCCONS, NULL) < 0) { +#ifdef __linux__ + if (ioctl(pts, TIOCCONS, NULL) < 0) +#else /* BSD usage of ioctl TIOCCONS. */ + if (ioctl(pts, TIOCCONS, &on) < 0) +#endif + { fprintf(stderr, "bootlogd: ioctl(%s, TIOCCONS): %s\n", buf, strerror(errno)); return 1; diff --git a/src/init.c b/src/init.c index 723c60a..5c64519 100644 --- a/src/init.c +++ b/src/init.c @@ -753,11 +753,11 @@ void console_stty(void) #ifdef __FreeBSD_kernel__ /* * The kernel of FreeBSD expects userland to set TERM. Usually, we want - * "cons25". Later, gettys might disagree on this (i.e. we're not using + * "xterm". Later, gettys might disagree on this (i.e. we're not using * syscons) but some boot scripts, like /etc/init.d/xserver-xorg, still * need a non-dumb terminal. */ - putenv ("TERM=cons25"); + putenv ("TERM=xterm"); #endif (void) tcgetattr(fd, &tty);