Add vtxx option to kdrive servers

This commit is contained in:
Keith Packard 2002-10-08 21:28:05 +00:00
parent f214cab20b
commit b5d1c53862
3 changed files with 22 additions and 9 deletions

View File

@ -75,16 +75,21 @@ LinuxInit ()
FatalError("LinuxInit: Server must be suid root\n");
}
if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
if (kdVirtualTerminal >= 0)
vtno = kdVirtualTerminal;
else
{
FatalError(
"LinuxInit: Cannot open /dev/tty0 (%s)\n",
strerror(errno));
}
if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) ||
(vtno == -1))
{
FatalError("xf86OpenConsole: Cannot find a free VT\n");
if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
{
FatalError(
"LinuxInit: Cannot open /dev/tty0 (%s)\n",
strerror(errno));
}
if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) ||
(vtno == -1))
{
FatalError("xf86OpenConsole: Cannot find a free VT\n");
}
}
close(fd);

View File

@ -53,6 +53,7 @@ Bool kdEmulateMiddleButton;
Bool kdDisableZaphod;
Bool kdEnabled;
int kdSubpixelOrder;
int kdVirtualTerminal = -1;
Bool kdSwitchPending;
DDXPointRec kdOrigin;
@ -342,6 +343,7 @@ ddxUseMsg()
ErrorF("-videoTest Start the server, pause momentarily and exit\n");
ErrorF("-origin X,Y Locates the next screen in the the virtual screen (Xinerama)\n");
ErrorF("-mouse path[,n] Filename of mouse device, n is number of buttons\n");
ErrorF("vtxx Use virtual terminal xx instead of the next available\n");
ErrorF("\n");
}
@ -738,6 +740,11 @@ KdProcessArgument (int argc, char **argv, int i)
UseMsg ();
return 2;
}
if (!strncmp (argv[i], "vt", 2) &&
sscanf (argv[i], "vt%2d", &kdVirtualTerminal) == 1)
{
return 1;
}
#ifdef PSEUDO8
return p8ProcessArgument (argc, argv, i);
#else

View File

@ -309,6 +309,7 @@ extern Bool kdEnabled;
extern Bool kdSwitchPending;
extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod;
extern int kdVirtualTerminal;
extern KdOsFuncs *kdOsFuncs;
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \