[comp.windows.x] Changes to X server to cleanup properly on errors

clyde@ut-ngp.UUCP (03/25/87)

Here are some modification to the X server to make it clean things up
before performing an error exit.  The cavalier attitude of X about bailing
out on error burned me when I started running the most recent modifications
for SUNs.  Xsun remaps the keyboard and if it terminates with an error,
it will leave the keyboard totally screwed up.

(The DisplayDead routine for the SUN resets the keymap).

---- Cut here and apply to X/main.c (not really a patch file) ----

  Error (where)
  	char *where;
  {
+ 	int i;
+ 
  	fprintf (stderr, "fatal ");
  	Notice (where);
  	if (errdelay)
  	    sleep (errdelay);
+ 	for (i = firstsock; i < maxsock; i++) {
+ 	    if (socketOn[i])
+ 		close (i);
+ 	}
+ 	DisplayDead ();
  	exit (1);
  }
-- 
Shouter-To-Dead-Parrots @ Univ. of Texas Computation Center; Austin, Texas  
	clyde@ngp.cc.utexas.edu; ...!ut-sally!ut-ngp!clyde
"It's a sort of a threat, you see.  I've never been very good at them
myself, but I've told they can be very effective."