]> git.pld-linux.org Git - packages/SysVinit.git/blob - 95_kfreebsd_bootlogd.patch
- updated to 3.04
[packages/SysVinit.git] / 95_kfreebsd_bootlogd.patch
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
6 Fixes:   #576443
7 Status:  applied upstream
8
9 --- sysvinit-2.88dsf.debian/src/bootlogd.c
10 +++ sysvinit-2.88dsf/src/bootlogd.c
11 @@ -482,6 +482,9 @@
12         int             realfd;
13         int             n, m, i;
14         int             todo;
15 +#ifndef __linux__      /* BSD-style ioctl needs an argument. */
16 +       int             on = 1;
17 +#endif
18  
19         fp = NULL;
20         logfile = LOGFILE;
21 @@ -554,15 +557,20 @@
22                 return 1;
23         }
24  
25 +#ifdef __linux__
26         (void)ioctl(0, TIOCCONS, NULL);
27 -#if 1
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);
31                 close(n);
32         }
33  #endif
34 -       if (ioctl(pts, TIOCCONS, NULL) < 0) {
35 +#ifdef __linux__
36 +       if (ioctl(pts, TIOCCONS, NULL) < 0)
37 +#else  /* BSD usage of ioctl TIOCCONS. */
38 +       if (ioctl(pts, TIOCCONS, &on) < 0)
39 +#endif
40 +       {
41                 fprintf(stderr, "bootlogd: ioctl(%s, TIOCCONS): %s\n",
42                         buf, strerror(errno));
43                 return 1;
This page took 0.089104 seconds and 3 git commands to generate.