summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2015-12-24 18:34:04 +0100
committerMatthieu Herrb <matthieu@herrb.eu>2015-12-24 18:34:04 +0100
commit6916a555c336938e1657cf5aad3059b4e4c59b7a (patch)
tree054f6a03e188f53cccafc90d7d100b26c7456e1a
parentfe28bc4657b22102d1ce35837553846b8026e8a0 (diff)
Remove X server ping code, only used for remote servers.
-rw-r--r--greeter/greet.c25
-rw-r--r--include/dm.h3
-rw-r--r--include/greet.h2
-rw-r--r--xdm/dm.c10
-rw-r--r--xdm/resource.c4
-rw-r--r--xdm/server.c56
-rw-r--r--xdm/session.c26
7 files changed, 1 insertions, 125 deletions
diff --git a/greeter/greet.c b/greeter/greet.c
index e82a904..ed20085 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -88,22 +88,7 @@ static char name[NAME_LEN], password[PASSWORD_LEN];
static Widget toplevel;
static Widget login;
static XtAppContext context;
-static XtIntervalId pingTimeout;
-/*ARGSUSED*/
-static void
-GreetPingServer (
- XtPointer closure,
- XtIntervalId *intervalId)
-{
- struct display *d;
-
- d = (struct display *) closure;
- if (!PingServer (d, XtDisplay (toplevel)))
- SessionPingFailed (d);
- pingTimeout = XtAppAddTimeOut (context, d->pingInterval * 60 * 1000,
- GreetPingServer, (closure));
-}
/*ARGSUSED*/
static void
@@ -216,11 +201,6 @@ InitGreet (struct display *d)
XWidthOfScreen(scrn) / 2,
XHeightOfScreen(scrn) / 2);
- if (d->pingInterval)
- {
- pingTimeout = XtAppAddTimeOut (context, d->pingInterval * 60 * 1000,
- GreetPingServer, (XtPointer) d);
- }
return dpy;
}
@@ -231,11 +211,6 @@ CloseGreet (struct display *d)
Arg arglist[1];
Display *dpy = XtDisplay(toplevel);
- if (pingTimeout)
- {
- XtRemoveTimeOut (pingTimeout);
- pingTimeout = 0;
- }
UnsecureDisplay (d, dpy);
XtSetArg (arglist[0], XtNallowAccess, (char *) &allow);
XtGetValues (login, arglist, 1);
diff --git a/include/dm.h b/include/dm.h
index 85cd07c..0122046 100644
--- a/include/dm.h
+++ b/include/dm.h
@@ -132,8 +132,6 @@ struct display {
int openTimeout; /* abort open attempt timeout */
int startAttempts; /* number of attempts at starting */
int reservAttempts; /* allowed start-IO error sequences */
- int pingInterval; /* interval between XSync */
- int pingTimeout; /* timeout for XSync */
int terminateServer;/* restart for each session */
int grabServer; /* keep server grabbed for Login */
int grabTimeout; /* time to wait for grab */
@@ -326,7 +324,6 @@ extern void ReinitResources (void);
/* in session.c */
extern char **defaultEnv (void);
extern char **systemEnv (struct display *d, char *user, char *home);
-extern int PingServer(struct display *d, Display *alternateDpy);
extern int source (char **environ, char *file);
extern void ClearCloseOnFork (int fd);
extern void DeleteXloginResources (struct display *d, Display *dpy);
diff --git a/include/greet.h b/include/greet.h
index 81f4537..55ffa6b 100644
--- a/include/greet.h
+++ b/include/greet.h
@@ -52,8 +52,6 @@ from The Open Group.
#endif
struct dlfuncs {
- int (*_PingServer)(struct display *d, Display *alternateDpy);
- void (*_SessionPingFailed)(struct display *d);
void (*_Debug)(const char * fmt, ...);
void (*_RegisterCloseOnFork)(int fd);
void (*_SecureDisplay)(struct display *d, Display *dpy);
diff --git a/xdm/dm.c b/xdm/dm.c
index 515234c..cf153d3 100644
--- a/xdm/dm.c
+++ b/xdm/dm.c
@@ -592,10 +592,6 @@ StartDisplay (struct display *d)
LoadServerResources (d);
if (d->displayType.location == Local)
{
- /* don't bother pinging local displays; we'll
- * certainly notice when they exit
- */
- d->pingInterval = 0;
if (d->authorize)
{
Debug ("SetLocalAuthorization %s, auth %s\n",
@@ -617,12 +613,6 @@ StartDisplay (struct display *d)
return;
}
}
- else
- {
- /* this will only happen when using XDMCP */
- if (d->authorizations)
- SaveServerAuthorizations (d, d->authorizations, d->authNum);
- }
if (!nofork_session)
pid = fork ();
else
diff --git a/xdm/resource.c b/xdm/resource.c
index 83901a2..944f0e0 100644
--- a/xdm/resource.c
+++ b/xdm/resource.c
@@ -224,10 +224,6 @@ struct displayResource serverResources[] = {
"4" },
{ "reservAttempts","ReservAttempts",DM_INT, boffset(reservAttempts),
"2" },
-{ "pingInterval","PingInterval",DM_INT, boffset(pingInterval),
- "5" },
-{ "pingTimeout","PingTimeout", DM_INT, boffset(pingTimeout),
- "5" },
{ "terminateServer","TerminateServer",DM_BOOL, boffset(terminateServer),
"false" },
{ "grabServer", "GrabServer", DM_BOOL, boffset(grabServer),
diff --git a/xdm/server.c b/xdm/server.c
index 27bf7a8..ccca01c 100644
--- a/xdm/server.c
+++ b/xdm/server.c
@@ -279,59 +279,3 @@ ResetServer (struct display *d)
pseudoReset (d->dpy);
}
-static Jmp_buf pingTime;
-
-static void
-PingLost (void)
-{
- Longjmp (pingTime, 1);
-}
-
-/* ARGSUSED */
-static int
-PingLostIOErr (Display *dpy)
-{
- PingLost();
- return 0;
-}
-
-/* ARGSUSED */
-static SIGVAL
-PingLostSig (int n)
-{
- PingLost();
-}
-
-int
-PingServer (struct display *d, Display *alternateDpy)
-{
- int (*oldError)(Display *);
- SIGVAL (*oldSig)(int);
- int oldAlarm;
- static Display *aDpy;
-
- aDpy = (alternateDpy != NULL ? alternateDpy : d->dpy);
- oldError = XSetIOErrorHandler (PingLostIOErr);
- oldAlarm = alarm (0);
- oldSig = signal (SIGALRM, PingLostSig);
- (void) alarm (d->pingTimeout * 60);
- if (!Setjmp (pingTime))
- {
- Debug ("Ping server\n");
- XSync (aDpy, 0);
- }
- else
- {
- Debug ("Server dead\n");
- (void) alarm (0);
- (void) signal (SIGALRM, SIG_DFL);
- XSetIOErrorHandler (oldError);
- return 0;
- }
- (void) alarm (0);
- (void) signal (SIGALRM, oldSig);
- (void) alarm (oldAlarm);
- Debug ("Server alive\n");
- XSetIOErrorHandler (oldError);
- return 1;
-}
diff --git a/xdm/session.c b/xdm/session.c
index a094984..ef072e8 100644
--- a/xdm/session.c
+++ b/xdm/session.c
@@ -59,8 +59,6 @@ static int runAndWait (char **args, char **environ);
static struct dlfuncs dlfuncs = {
- PingServer,
- SessionPingFailed,
Debug,
RegisterCloseOnFork,
SecureDisplay,
@@ -159,15 +157,6 @@ AbortClient (pid_t pid)
}
}
-void
-SessionPingFailed (struct display *d)
-{
- if (clientPid > 1) {
- AbortClient (clientPid);
- source (verify.systemEnviron, d->reset);
- }
- SessionExit (d, RESERVER_DISPLAY, TRUE);
-}
/*
* We need our own error handlers because we can't be sure what exit code Xlib
@@ -238,20 +227,7 @@ ManageSession (struct display *d)
* Wait for session to end,
*/
for (;;) {
- if (d->pingInterval) {
- if (!Setjmp (pingTime)) {
- (void) signal (SIGALRM, catchAlrm);
- (void) alarm (d->pingInterval * 60);
- pid = wait ((waitType *) 0);
- (void) alarm (0);
- } else {
- (void) alarm (0);
- if (!PingServer (d, (Display *) NULL))
- SessionPingFailed (d);
- }
- } else {
- pid = wait ((waitType *) 0);
- }
+ pid = wait ((waitType *) 0);
if (pid == clientPid)
break;
}