Merge remote-tracking branch 'alanc/master'

This commit is contained in:
Keith Packard 2011-09-21 14:30:19 -07:00
commit 98f4940093
12 changed files with 621 additions and 543 deletions

View File

@ -3442,8 +3442,7 @@ CloseDownClient(ClientPtr client)
* now. If it hasn't gotten to Running, nClients has *not* * now. If it hasn't gotten to Running, nClients has *not*
* been incremented, so *don't* decrement it. * been incremented, so *don't* decrement it.
*/ */
if (client->clientState != ClientStateInitial && if (client->clientState != ClientStateInitial)
client->clientState != ClientStateAuthenticating )
{ {
--nClients; --nClients;
} }
@ -3705,19 +3704,8 @@ ProcEstablishConnection(ClientPtr client)
auth_proto, auth_proto,
(unsigned short)prefix->nbytesAuthString, (unsigned short)prefix->nbytesAuthString,
auth_string); auth_string);
/*
* If Kerberos is being used for this client, the clientState return(SendConnSetup(client, reason));
* will be set to ClientStateAuthenticating at this point.
* More messages need to be exchanged among the X server, Kerberos
* server, and client to figure out if everyone is authorized.
* So we don't want to send the connection setup info yet, since
* the auth step isn't really done.
*/
if (client->clientState == ClientStateCheckingSecurity)
client->clientState = ClientStateCheckedSecurity;
else if (client->clientState != ClientStateAuthenticating)
return(SendConnSetup(client, reason));
return Success;
} }
void void

View File

@ -103,6 +103,8 @@ xf86InfoRec xf86Info = {
.vtPendingNum = -1, .vtPendingNum = -1,
#endif #endif
.dontVTSwitch = FALSE, .dontVTSwitch = FALSE,
.autoVTSwitch = TRUE,
.ShareVTs = FALSE,
.dontZap = FALSE, .dontZap = FALSE,
.dontZoom = FALSE, .dontZoom = FALSE,
.notrapSignals = FALSE, .notrapSignals = FALSE,

View File

@ -1352,6 +1352,16 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86xkbdirFlag = TRUE; xf86xkbdirFlag = TRUE;
return 0; return 0;
} }
if (!strcmp(argv[i], "-novtswitch"))
{
xf86Info.autoVTSwitch = FALSE;
return 1;
}
if (!strcmp(argv[i], "-sharevts"))
{
xf86Info.ShareVTs = TRUE;
return 1;
}
/* OS-specific processing */ /* OS-specific processing */
return xf86ProcessArgument(argc, argv, i); return xf86ProcessArgument(argc, argv, i);
@ -1408,6 +1418,8 @@ ddxUseMsg(void)
ErrorF("-version show the server version\n"); ErrorF("-version show the server version\n");
ErrorF("-showDefaultModulePath show the server default module path\n"); ErrorF("-showDefaultModulePath show the server default module path\n");
ErrorF("-showDefaultLibPath show the server default library path\n"); ErrorF("-showDefaultLibPath show the server default library path\n");
ErrorF("-novtswitch don't automatically switch VT at reset & exit\n");
ErrorF("-sharevts share VTs with another X server\n");
/* OS-specific usage */ /* OS-specific usage */
xf86UseMsg(); xf86UseMsg();
ErrorF("\n"); ErrorF("\n");

View File

@ -66,6 +66,8 @@ typedef struct {
int vtPendingNum; int vtPendingNum;
#endif #endif
Bool dontVTSwitch; Bool dontVTSwitch;
Bool autoVTSwitch;
Bool ShareVTs;
Bool dontZap; Bool dontZap;
Bool dontZoom; Bool dontZoom;
Bool notrapSignals; /* don't exit cleanly - die at fault */ Bool notrapSignals; /* don't exit cleanly - die at fault */

File diff suppressed because it is too large Load Diff

View File

@ -334,6 +334,10 @@ as root (i.e, with real-uid 0).
.B \-nosilk .B \-nosilk
Disable Silken Mouse support. Disable Silken Mouse support.
.TP 8 .TP 8
.B \-novtswitch
Disable the automatic switching on X server reset and shutdown to the
VT that was active when the server started, if supported by the OS.
.TP 8
.B \-pixmap24 .B \-pixmap24
Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel. Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel.
The default is usually 32 bits per pixel. There is normally little The default is usually 32 bits per pixel. There is normally little
@ -376,6 +380,9 @@ and
.B \-ggamma .B \-ggamma
options. options.
.TP 8 .TP 8
.B \-sharevts
Share virtual terminals with another X server, if supported by the OS.
.TP 8
.BI \-screen " screen-name" .BI \-screen " screen-name"
Use the __xconfigfile__(__filemansuffix__) file Use the __xconfigfile__(__filemansuffix__) file
.B Screen .B Screen

View File

@ -45,7 +45,6 @@ static int devConsoleFd = -1;
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
static int VTnum = -1; static int VTnum = -1;
static int initialVT = -1; static int initialVT = -1;
static Bool ShareVTs = FALSE;
#endif #endif
#ifdef PCCONS_SUPPORT #ifdef PCCONS_SUPPORT
@ -266,7 +265,7 @@ xf86OpenConsole()
} }
#endif #endif
acquire_vt: acquire_vt:
if (!ShareVTs) { if (!xf86Info.ShareVTs) {
/* /*
* now get the VT * now get the VT
*/ */
@ -304,7 +303,7 @@ acquire_vt:
{ {
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed"); FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
} }
} else { /* ShareVTs */ } else { /* xf86Info.ShareVTs */
close(xf86Info.consoleFd); close(xf86Info.consoleFd);
} }
break; break;
@ -320,7 +319,8 @@ acquire_vt:
{ {
/* serverGeneration != 1 */ /* serverGeneration != 1 */
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
if (!ShareVTs) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) if (!xf86Info.ShareVTs &&
(xf86Info.consType == SYSCONS || xf86Info.consType == PCVT))
{ {
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
{ {
@ -393,7 +393,7 @@ xf86OpenSyscons()
if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0) if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0)
initialVT = -1; initialVT = -1;
#endif #endif
if (ShareVTs) if (xf86Info.ShareVTs)
xf86Info.vtno = initialVT; xf86Info.vtno = initialVT;
if (xf86Info.vtno == -1) if (xf86Info.vtno == -1)
@ -655,7 +655,7 @@ xf86CloseConsole()
struct vt_mode VT; struct vt_mode VT;
#endif #endif
if (ShareVTs) return; if (xf86Info.ShareVTs) return;
switch (xf86Info.consType) switch (xf86Info.consType)
{ {
@ -723,11 +723,6 @@ xf86ProcessArgument(int argc, char *argv[], int i)
return 1; return 1;
} }
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) #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 ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{ {
if (sscanf(argv[i], "vt%2d", &VTnum) == 0 || if (sscanf(argv[i], "vt%2d", &VTnum) == 0 ||

View File

@ -39,8 +39,6 @@
#include <sys/stat.h> #include <sys/stat.h>
static Bool KeepTty = FALSE; static Bool KeepTty = FALSE;
static Bool VTSwitch = TRUE;
static Bool ShareVTs = FALSE;
static int activeVT = -1; static int activeVT = -1;
static char vtname[11]; static char vtname[11];
@ -109,7 +107,7 @@ xf86OpenConsole(void)
"xf86OpenConsole: Cannot open /dev/tty0 (%s)\n", "xf86OpenConsole: Cannot open /dev/tty0 (%s)\n",
strerror(errno)); strerror(errno));
if (ShareVTs) if (xf86Info.ShareVTs)
{ {
SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts)); SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
if (ret < 0) if (ret < 0)
@ -184,7 +182,7 @@ xf86OpenConsole(void)
} }
#endif #endif
if (!ShareVTs) if (!xf86Info.ShareVTs)
{ {
struct termios nTty; struct termios nTty;
@ -240,7 +238,7 @@ xf86OpenConsole(void)
* of Init?$#*&Device(). So I just place it here */ * of Init?$#*&Device(). So I just place it here */
} }
} else { /* serverGeneration != 1 */ } else { /* serverGeneration != 1 */
if (!ShareVTs && VTSwitch) if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch)
{ {
/* now get the VT */ /* now get the VT */
switch_to(xf86Info.vtno, "xf86OpenConsole"); switch_to(xf86Info.vtno, "xf86OpenConsole");
@ -254,7 +252,7 @@ xf86CloseConsole(void)
struct vt_mode VT; struct vt_mode VT;
int ret; int ret;
if (ShareVTs) { if (xf86Info.ShareVTs) {
close(xf86Info.consoleFd); close(xf86Info.consoleFd);
return; return;
} }
@ -286,7 +284,7 @@ xf86CloseConsole(void)
strerror(errno)); strerror(errno));
} }
if (VTSwitch) if (xf86Info.autoVTSwitch)
{ {
/* /*
* Perform a switch back to the active VT when we were started * Perform a switch back to the active VT when we were started
@ -311,16 +309,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
KeepTty = TRUE; KeepTty = TRUE;
return 1; return 1;
} }
if (!strcmp(argv[i], "-novtswitch"))
{
VTSwitch = FALSE;
return 1;
}
if (!strcmp(argv[i], "-sharevts"))
{
ShareVTs = TRUE;
return 1;
}
if ((argv[i][0] == 'v') && (argv[i][1] == 't')) if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{ {
if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0) if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0)
@ -340,6 +329,4 @@ xf86UseMsg(void)
ErrorF("vtXX use the specified VT number\n"); ErrorF("vtXX use the specified VT number\n");
ErrorF("-keeptty "); ErrorF("-keeptty ");
ErrorF("don't detach controlling tty (for debugging only)\n"); ErrorF("don't detach controlling tty (for debugging only)\n");
ErrorF("-novtswitch don't immediately switch to new VT\n");
ErrorF("-sharevts share VTs with another X server\n");
} }

View File

@ -63,6 +63,22 @@ static char consoleDev[PATH_MAX] = "/dev/fb";
Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */ Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb"; _X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
static void
switch_to(int vt, const char *from)
{
int ret;
SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt));
if (ret != 0)
xf86Msg(X_WARNING, "%s: VT_ACTIVATE failed: %s\n",
from, strerror(errno));
SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt));
if (ret != 0)
xf86Msg(X_WARNING, "%s: VT_WAITACTIVE failed: %s\n",
from, strerror(errno));
}
void void
xf86OpenConsole(void) xf86OpenConsole(void)
{ {
@ -170,6 +186,11 @@ xf86OpenConsole(void)
xf86Info.vtno = VTnum; xf86Info.vtno = VTnum;
from = X_CMDLINE; from = X_CMDLINE;
} }
else if (xf86Info.ShareVTs)
{
xf86Info.vtno = vtinfo.v_active;
from = X_CMDLINE;
}
else else
{ {
if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
@ -201,16 +222,15 @@ OPENCONSOLE:
chown(consoleDev, getuid(), getgid()); chown(consoleDev, getuid(), getgid());
#ifdef HAS_USL_VTS #ifdef HAS_USL_VTS
if (xf86Info.ShareVTs)
return;
if (vtEnabled) if (vtEnabled)
{ {
/* /*
* Now get the VT * Now get the VT
*/ */
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) switch_to(xf86Info.vtno, "xf86OpenConsole");
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
#ifdef VT_SET_CONSUSER /* added in snv_139 */ #ifdef VT_SET_CONSUSER /* added in snv_139 */
if (strcmp(display, "0") == 0) if (strcmp(display, "0") == 0)
@ -249,16 +269,13 @@ OPENCONSOLE:
else /* serverGeneration != 1 */ else /* serverGeneration != 1 */
{ {
#ifdef HAS_USL_VTS #ifdef HAS_USL_VTS
if (vtEnabled) if (vtEnabled && !xf86Info.ShareVTs)
{ {
/* /*
* Now re-get the VT * Now re-get the VT
*/ */
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) if (xf86Info.autoVTSwitch)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); switch_to(xf86Info.vtno, "xf86OpenConsole");
if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
#ifdef VT_SET_CONSUSER /* added in snv_139 */ #ifdef VT_SET_CONSUSER /* added in snv_139 */
if (strcmp(display, "0") == 0) if (strcmp(display, "0") == 0)
@ -347,7 +364,8 @@ xf86CloseConsole(void)
} }
/* Activate the VT that X was started on */ /* Activate the VT that X was started on */
ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT); if (xf86Info.autoVTSwitch)
switch_to(xf86StartVT, "xf86CloseConsole");
} }
#endif /* HAS_USL_VTS */ #endif /* HAS_USL_VTS */

View File

@ -1,4 +1,3 @@
.\" $XFree86$
.TH CVT 1 __vendorversion__ .TH CVT 1 __vendorversion__
.SH NAME .SH NAME
cvt - calculate VESA CVT mode lines cvt - calculate VESA CVT mode lines
@ -32,7 +31,7 @@ Create a mode with reduced blanking. This allows for higher frequency signals,
with a lower or equal dotclock. Not for Cathode Ray Tube based displays though. with a lower or equal dotclock. Not for Cathode Ray Tube based displays though.
.SH "SEE ALSO" .SH "SEE ALSO"
__xconfigfile__(__filemansuffix__) __xconfigfile__(__filemansuffix__), gtf(__appmansuffix__)
.SH AUTHOR .SH AUTHOR
Luc Verhaegen. Luc Verhaegen.
.PP .PP

View File

@ -1,4 +1,3 @@
.\" $XFree86$
.TH GTF 1 __vendorversion__ .TH GTF 1 __vendorversion__
.SH NAME .SH NAME
gtf - calculate VESA GTF mode lines gtf - calculate VESA GTF mode lines
@ -35,7 +34,7 @@ default format.
Print the mode parameters in a format suitable for Print the mode parameters in a format suitable for
.BR fbset(8) . .BR fbset(8) .
.SH "SEE ALSO" .SH "SEE ALSO"
__xconfigfile__(__filemansuffix__) __xconfigfile__(__filemansuffix__), cvt(__appmansuffix__)
.SH AUTHOR .SH AUTHOR
Andy Ritger. Andy Ritger.
.PP .PP

View File

@ -57,12 +57,11 @@ extern _X_EXPORT void ReplyNotSwappd (
void * /* pbuf */) _X_NORETURN; void * /* pbuf */) _X_NORETURN;
typedef enum {ClientStateInitial, typedef enum {ClientStateInitial,
ClientStateAuthenticating, /* 1 is unused now, was ClientStateAuthenticating */
ClientStateRunning, ClientStateRunning = 2,
ClientStateRetained, ClientStateRetained,
ClientStateGone, ClientStateGone
ClientStateCheckingSecurity, } ClientState;
ClientStateCheckedSecurity} ClientState;
#ifdef XFIXES #ifdef XFIXES
typedef struct _saveSet { typedef struct _saveSet {