summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2008-12-16 00:07:42 -0500
committerRobert Noland <rnoland@2hip.net>2008-12-16 00:10:59 -0500
commit7aa29b9d66c3cd0f8af4fafbe92efd0c0556d225 (patch)
tree0e7da6b7a6133e14807a23140e2caf77eac6b5e8
parent063eb6743cd0d98dd52d1a9559b804381ee5144d (diff)
Support -sharevts on FreeBSD
Bugzilla #11179 Submitted-by: Nathan Whitehorn Signed-off-by: Robert Noland <rnoland@2hip.net>
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index cbb9e4810..7698084ee 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -45,6 +45,7 @@ static int devConsoleFd = -1;
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
static int VTnum = -1;
static int initialVT = -1;
+static Bool ShareVTs = FALSE;
#endif
#ifdef PCCONS_SUPPORT
@@ -269,6 +270,7 @@ xf86OpenConsole()
}
#endif
acquire_vt:
+ if (!ShareVTs) {
/*
* now get the VT
*/
@@ -306,6 +308,9 @@ acquire_vt:
{
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
}
+ } else { /* ShareVTs */
+ close(xf86Info.consoleFd);
+ }
break;
#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
#ifdef WSCONS_SUPPORT
@@ -319,7 +324,7 @@ acquire_vt:
{
/* serverGeneration != 1 */
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)
+ if (!ShareVTs) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)
{
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
{
@@ -392,6 +397,9 @@ xf86OpenSyscons()
if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0)
initialVT = -1;
#endif
+ if (ShareVTs)
+ xf86Info.vtno = initialVT;
+
if (xf86Info.vtno == -1)
{
/*
@@ -651,6 +659,8 @@ xf86CloseConsole()
struct vt_mode VT;
#endif
+ if (ShareVTs) return;
+
switch (xf86Info.consType)
{
#ifdef PCCONS_SUPPORT
@@ -717,6 +727,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
return(1);
}
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ if (!strcmp(argv[i], "-sharevts"))
+ {
+ ShareVTs = TRUE;
+ return(1);
+ }
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
if (sscanf(argv[i], "vt%2d", &VTnum) == 0 ||
@@ -737,6 +752,7 @@ xf86UseMsg()
{
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
ErrorF("vtXX use the specified VT number (1-12)\n");
+ ErrorF("-sharevts share VTs with another X server\n");
#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
ErrorF("-keeptty ");
ErrorF("don't detach controlling tty (for debugging only)\n");