Annotation of /trunk/xorg-old/patches-6.8.2-r10/0350_all_4.2.0-vt7.patch
Parent Directory | Revision Log
Revision 167 -
(hide annotations)
(download)
Tue May 8 20:58:51 2007 UTC (17 years, 4 months ago) by niro
File size: 1034 byte(s)
Tue May 8 20:58:51 2007 UTC (17 years, 4 months ago) by niro
File size: 1034 byte(s)
-import
1 | niro | 167 | --- XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c.fred 2001-10-31 23:50:30.000000000 +0100 |
2 | +++ XFree86-4.2.0/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c 2002-08-14 15:22:56.000000000 +0200 | ||
3 | @@ -76,6 +76,7 @@ | ||
4 | xf86Info.vtno = VTnum; | ||
5 | from = X_CMDLINE; | ||
6 | } else { | ||
7 | + struct vt_stat vtstat; | ||
8 | i=0; | ||
9 | while (tty0[i] != NULL) | ||
10 | { | ||
11 | @@ -87,9 +88,19 @@ | ||
12 | FatalError( | ||
13 | "xf86OpenConsole: Cannot open /dev/tty0 (%s)\n", | ||
14 | strerror(errno)); | ||
15 | - if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || | ||
16 | - (xf86Info.vtno == -1)) { | ||
17 | + | ||
18 | + if ((ioctl(fd, VT_GETSTATE, &vtstat) < 0)) { | ||
19 | FatalError("xf86OpenConsole: Cannot find a free VT\n"); | ||
20 | + } else { | ||
21 | + for(xf86Info.vtno=7; xf86Info.vtno<64; xf86Info.vtno++) { | ||
22 | + if (!(vtstat.v_state & (1 << xf86Info.vtno))) { | ||
23 | + break; | ||
24 | + } | ||
25 | + } | ||
26 | + if (xf86Info.vtno == 64) { | ||
27 | + FatalError("xf86OpenConsole: Cannot find a free VT\n"); | ||
28 | + } | ||
29 | + ErrorF("Using vt %d\n", xf86Info.vtno); | ||
30 | } | ||
31 | close(fd); | ||
32 | } |