Updated bootlogd and init to better compile and run on GNU/kFreeBSD.
This commit is contained in:
parent
80dbcf3de3
commit
f52d703c8e
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user