|
1 From f094c8bae6188f8d6ba0913dcf6a657363948813 Mon Sep 17 00:00:00 2001 |
|
2 From: Alan Coopersmith <[email protected]> |
|
3 Date: Mon, 24 Nov 2008 14:58:43 -0800 |
|
4 Subject: [PATCH] Solaris: Make KDSETMODE failure non fatal, and retry it on interrupts |
|
5 |
|
6 --- |
|
7 hw/xfree86/os-support/solaris/sun_init.c | 14 ++++++++++---- |
|
8 1 files changed, 10 insertions(+), 4 deletions(-) |
|
9 |
|
10 diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c |
|
11 index b79814d..795b0c1 100644 |
|
12 --- a/hw/xfree86/os-support/solaris/sun_init.c |
|
13 +++ b/hw/xfree86/os-support/solaris/sun_init.c |
|
14 @@ -49,8 +49,9 @@ static char fb_dev[PATH_MAX] = "/dev/console"; |
|
15 void |
|
16 xf86OpenConsole(void) |
|
17 { |
|
18 + int i; |
|
19 #ifdef HAS_USL_VTS |
|
20 - int fd, i; |
|
21 + int fd; |
|
22 struct vt_mode VT; |
|
23 struct vt_stat vtinfo; |
|
24 int FreeVTslot; |
|
25 @@ -173,9 +174,14 @@ xf86OpenConsole(void) |
|
26 if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) |
|
27 FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); |
|
28 #endif |
|
29 + |
|
30 #ifdef KDSETMODE |
|
31 - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) |
|
32 - FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); |
|
33 + SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS)); |
|
34 + if (i < 0) { |
|
35 + xf86Msg(X_WARNING, |
|
36 + "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n", |
|
37 + fb_dev, strerror(errno)); |
|
38 + } |
|
39 #endif |
|
40 } |
|
41 else /* serverGeneration != 1 */ |
|
42 @@ -257,7 +263,7 @@ xf86CloseConsole(void) |
|
43 |
|
44 #ifdef KDSETMODE |
|
45 /* Reset the display back to text mode */ |
|
46 - ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); |
|
47 + SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT)); |
|
48 #endif |
|
49 |
|
50 #ifdef HAS_USL_VTS |
|
51 -- |
|
52 1.5.6.5 |
|
53 |