Solaris: Make KDSETMODE failure non fatal, and retry it on interrupts

This commit is contained in:
Alan Coopersmith 2008-11-24 20:32:20 -08:00
parent 3e6da16360
commit 75784e1e53

View File

@ -49,8 +49,9 @@ static char fb_dev[PATH_MAX] = "/dev/console";
void void
xf86OpenConsole(void) xf86OpenConsole(void)
{ {
int i;
#ifdef HAS_USL_VTS #ifdef HAS_USL_VTS
int fd, i; int fd;
struct vt_mode VT; struct vt_mode VT;
struct vt_stat vtinfo; struct vt_stat vtinfo;
int FreeVTslot; int FreeVTslot;
@ -173,9 +174,14 @@ xf86OpenConsole(void)
if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
#endif #endif
#ifdef KDSETMODE #ifdef KDSETMODE
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS));
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); if (i < 0) {
xf86Msg(X_WARNING,
"xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n",
fb_dev, strerror(errno));
}
#endif #endif
} }
else /* serverGeneration != 1 */ else /* serverGeneration != 1 */
@ -257,7 +263,7 @@ xf86CloseConsole(void)
#ifdef KDSETMODE #ifdef KDSETMODE
/* Reset the display back to text mode */ /* Reset the display back to text mode */
ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));
#endif #endif
#ifdef HAS_USL_VTS #ifdef HAS_USL_VTS