Commit e5f8b2e2 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

remove the connection to RedHat's default init as that just does some

Thu Jul 05 18:50:23 2001  George Lebl <jirka@5z.com>

	* gdm.spec.in: remove the connection to RedHat's default init as that
	  just does some background setting but we already set background
	  ourselves in a nicer way and this just resulted in a slowdown and
	  a flash

	* daemon/server.c, daemon/slave.c: be more thorough in closing
	  displays, never include an empty xioerror handler, and normally
	  xio errors do a DISPLAY_REMANAGE and only on server startup do they
	  do XFAILED.  Also before and after whacking clients grab/ungrab the
	  server as xdm does.

	* daemon/xdmcp.c: fix warnings
parent 9bb3ffb2
Thu Jul 05 18:50:23 2001 George Lebl <jirka@5z.com>
* gdm.spec.in: remove the connection to RedHat's default init as that
just does some background setting but we already set background
ourselves in a nicer way and this just resulted in a slowdown and
a flash
* daemon/server.c, daemon/slave.c: be more thorough in closing
displays, never include an empty xioerror handler, and normally
xio errors do a DISPLAY_REMANAGE and only on server startup do they
do XFAILED. Also before and after whacking clients grab/ungrab the
server as xdm does.
* daemon/xdmcp.c: fix warnings
Thu Jul 05 13:17:53 2001 George Lebl <jirka@5z.com>
* gui/gdmlogin.c: add kill_thingies to atexit to make sure that the
......
......@@ -71,8 +71,7 @@ static GdmDisplay *d = NULL;
void
gdm_server_reinit (GdmDisplay *disp)
{
if (disp == NULL ||
disp->servpid <= 0)
if (disp == NULL)
return;
/* Kill our connection if one existed */
......@@ -81,6 +80,9 @@ gdm_server_reinit (GdmDisplay *disp)
disp->dsp = NULL;
}
if (disp->servpid <= 0)
return;
gdm_debug ("gdm_server_reinit: Server for %s is about to be reinitialized!", disp->name);
kill (disp->servpid, SIGHUP);
......@@ -600,25 +602,19 @@ ignore_xerror_handler (Display *disp, XErrorEvent *evt)
return 0;
}
static int
ignore_xioerror_handler (Display *disp)
{
return 0;
}
void
gdm_server_whack_clients (GdmDisplay *disp)
{
int i, screen_count;
int (* old_xerror_handler) (Display *, XErrorEvent *);
int (* old_xioerror_handler) (Display *);
if (disp == NULL ||
disp->dsp == NULL)
return;
old_xerror_handler = XSetErrorHandler (ignore_xerror_handler);
old_xioerror_handler = XSetIOErrorHandler (ignore_xioerror_handler);
XGrabServer (disp->dsp);
screen_count = ScreenCount (disp->dsp);
......@@ -641,9 +637,10 @@ gdm_server_whack_clients (GdmDisplay *disp)
}
}
XUngrabServer (disp->dsp);
XSync (disp->dsp, False);
XSetErrorHandler (old_xerror_handler);
XSetIOErrorHandler (old_xioerror_handler);
}
......
......@@ -149,13 +149,6 @@ ignore_xerror_handler (Display *disp, XErrorEvent *evt)
return 0;
}
static int
ignore_xioerror_handler (Display *disp)
{
x_error_occured = TRUE;
return 0;
}
void
gdm_slave_start (GdmDisplay *display)
{
......@@ -288,18 +281,15 @@ gdm_screen_init (GdmDisplay *display)
{
#ifdef HAVE_LIBXINERAMA
int (* old_xerror_handler) (Display *, XErrorEvent *);
int (* old_xioerror_handler) (Display *);
gboolean have_xinerama = FALSE;
x_error_occured = FALSE;
old_xerror_handler = XSetErrorHandler (ignore_xerror_handler);
old_xioerror_handler = XSetIOErrorHandler (ignore_xioerror_handler);
have_xinerama = XineramaIsActive (display->dsp);
XSync (display->dsp, False);
XSetErrorHandler (old_xerror_handler);
XSetIOErrorHandler (old_xioerror_handler);
if (x_error_occured)
have_xinerama = FALSE;
......@@ -333,6 +323,7 @@ gdm_screen_init (GdmDisplay *display)
}
}
static gboolean do_xfailed_on_xio_error = FALSE;
static void
gdm_slave_run (GdmDisplay *display)
......@@ -374,6 +365,7 @@ gdm_slave_run (GdmDisplay *display)
/* X error handlers to avoid the default one (i.e. exit (1)) */
XSetErrorHandler (gdm_slave_xerror_handler);
XSetIOErrorHandler (gdm_slave_xioerror_handler);
do_xfailed_on_xio_error = TRUE;
/* We keep our own (windowless) connection (dsp) open to avoid the
* X server resetting due to lack of active connections. */
......@@ -417,6 +409,10 @@ gdm_slave_run (GdmDisplay *display)
XCloseDisplay (dsp);
}
/* OK from now on it's really the user whacking us most likely,
* we have already started up well */
do_xfailed_on_xio_error = FALSE;
/* If XDMCP setup pinging */
if (d->type != TYPE_LOCAL &&
GdmPingInterval > 0) {
......@@ -2119,7 +2115,6 @@ gdm_slave_session_cleanup (void)
/* things are going to be killed, so ignore errors */
XSetErrorHandler (ignore_xerror_handler);
XSetIOErrorHandler (ignore_xioerror_handler);
/* Cleanup */
gdm_debug ("gdm_slave_session_cleanup: Severing connection");
......@@ -2265,7 +2260,6 @@ gdm_slave_xerror_handler (Display *disp, XErrorEvent *evt)
return (0);
}
/* We respond to fatal errors by restarting the display */
static gint
gdm_slave_xioerror_handler (Display *disp)
......@@ -2297,9 +2291,10 @@ gdm_slave_xioerror_handler (Display *disp)
gdm_server_stop (d);
gdm_verify_cleanup ();
sigprocmask (SIG_SETMASK, &omask, NULL);
_exit (DISPLAY_XFAILED);
if (do_xfailed_on_xio_error)
_exit (DISPLAY_XFAILED);
else
_exit (DISPLAY_REMANAGE);
}
char *
......
......@@ -352,7 +352,7 @@ gdm_xdmcp_init (void)
serv_sa.sin_port = htons (GdmPort); /* UDP 177 */
serv_sa.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (xdmcpfd, (struct sockaddr_in *) &serv_sa, sizeof (serv_sa)) == -1) {
if (bind (xdmcpfd, (struct sockaddr*) &serv_sa, sizeof (serv_sa)) == -1) {
gdm_error (_("gdm_xdmcp_init: Could not bind to XDMCP socket!"));
gdm_xdmcp_close ();
GdmXdmcp = FALSE;
......@@ -710,7 +710,8 @@ gdm_xdmcp_send_willing (struct sockaddr_in *clnt_sa)
XdmcpWriteARRAY8 (&buf, &serv_authlist.authentication); /* Hardcoded authentication */
XdmcpWriteARRAY8 (&buf, &servhost);
XdmcpWriteARRAY8 (&buf, &status);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
}
static void
......@@ -733,7 +734,8 @@ gdm_xdmcp_send_unwilling (struct sockaddr_in *clnt_sa, gint type)
XdmcpWriteARRAY8 (&buf, &servhost);
XdmcpWriteARRAY8 (&buf, &status);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
}
static char *
......@@ -943,7 +945,8 @@ gdm_xdmcp_send_accept (const char *hostname,
XdmcpWriteARRAY8 (&buf, &authname);
XdmcpWriteARRAY8 (&buf, &authdata);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
gdm_debug ("gdm_xdmcp_send_accept: Sending ACCEPT to %s with SessionID=%ld",
inet_ntoa (clnt_sa->sin_addr), (long)d->sessionid);
......@@ -981,7 +984,8 @@ gdm_xdmcp_send_decline (struct sockaddr_in *clnt_sa)
XdmcpWriteARRAY8 (&buf, &authentype);
XdmcpWriteARRAY8 (&buf, &authendata);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
}
......@@ -1104,7 +1108,8 @@ gdm_xdmcp_send_refuse (struct sockaddr_in *clnt_sa, CARD32 sessid)
XdmcpWriteHeader (&buf, &header);
XdmcpWriteCARD32 (&buf, sessid);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
}
......@@ -1126,7 +1131,8 @@ gdm_xdmcp_send_failed (struct sockaddr_in *clnt_sa, CARD32 sessid)
XdmcpWriteHeader (&buf, &header);
XdmcpWriteCARD32 (&buf, sessid);
XdmcpWriteARRAY8 (&buf, &status);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
}
......@@ -1176,7 +1182,8 @@ gdm_xdmcp_send_alive (struct sockaddr_in *clnt_sa, CARD32 sessid)
XdmcpWriteHeader (&buf, &header);
XdmcpWriteCARD8 (&buf, 1);
XdmcpWriteCARD32 (&buf, sessid);
XdmcpFlush (xdmcpfd, &buf, clnt_sa, (int)sizeof (struct sockaddr_in));
XdmcpFlush (xdmcpfd, &buf, (XdmcpNetaddr)clnt_sa,
(int)sizeof (struct sockaddr_in));
}
......
......@@ -55,7 +55,8 @@ install -m 755 config/Gnome $RPM_BUILD_ROOT%{sysconfdir}/X11/gdm/Sessions/Gnome
ln -sf Default $RPM_BUILD_ROOT%{sysconfdir}/X11/gdm/Sessions/default
# change default Init script to be Red Hat default
ln -sf ../../xdm/Xsetup_0 $RPM_BUILD_ROOT%{sysconfdir}/X11/gdm/Init/Default
# Note that this just sets up background and we already do that ourselves
#ln -sf ../../xdm/Xsetup_0 $RPM_BUILD_ROOT%{sysconfdir}/X11/gdm/Init/Default
# run GiveConsole/TakeConsole
ln -sf ../../xdm/GiveConsole $RPM_BUILD_ROOT%{sysconfdir}/X11/gdm/PreSession/Default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment