VT activate or waitactive are fatal if they fail.

Also, be sure to waitactive on the way down, to make sure we're off the VT
before exiting.
This commit is contained in:
Adam Jackson 2007-04-09 19:04:56 -04:00
parent 72b477f964
commit a08d5157f7

View File

@ -245,15 +245,15 @@ xf86OpenConsole(void)
lnx_savefont();
#endif
/*
* now get the VT
* now get the VT. This _must_ succeed, or else fail completely.
*/
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
@ -350,6 +350,10 @@ xf86CloseConsole()
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0)
xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0)
xf86Msg(X_WARNING,
"xf86CloseConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
activeVT = -1;
}