1 Description: Adapt TIOCCONS call to kfreebsd.
2 Isolate Linux-only forms of ioctl call with TIOCCONS. The BSD form of
3 this needs a pointer to an integer, and its fails with a NULL pointer.
4 Author: Mats Erik Andersson <debian@gisladisker.se>
5 Last-Update: 2012-04-03
7 Status: applied upstream
9 --- sysvinit-2.88dsf.debian/src/bootlogd.c
10 +++ sysvinit-2.88dsf/src/bootlogd.c
15 +#ifndef __linux__ /* BSD-style ioctl needs an argument. */
26 (void)ioctl(0, TIOCCONS, NULL);
28 /* Work around bug in 2.1/2.2 kernels. Fixed in 2.2.13 and 2.3.18 */
29 if ((n = open("/dev/tty0", O_RDWR)) >= 0) {
30 (void)ioctl(n, TIOCCONS, NULL);
34 - if (ioctl(pts, TIOCCONS, NULL) < 0) {
36 + if (ioctl(pts, TIOCCONS, NULL) < 0)
37 +#else /* BSD usage of ioctl TIOCCONS. */
38 + if (ioctl(pts, TIOCCONS, &on) < 0)
41 fprintf(stderr, "bootlogd: ioctl(%s, TIOCCONS): %s\n",
42 buf, strerror(errno));