[7643] in Athena Bugs
Patches for xinit for AUX-2.0.1
daemon@ATHENA.MIT.EDU (Mark D. Virtue)
Sun Jun 9 22:37:15 1991
From: vrt@horton.mit.edu (Mark D. Virtue)
To: bugs@ATHENA.MIT.EDU
Cc: athena.mit.edu@rel-eng.aux.apple.com
Date: Sun, 09 Jun 91 22:38:27 EDT
Context diffs for our production xinit.c versus the X11R4 tape
follow, perhaps this will clear up the problem you see.
SCP
*** /tmp/,RCSt1a00874 Thu Apr 18 10:19:28 1991
- --- xinit.c Thu Aug 9 17:38:12 1990
***************
*** 81,87 ****
- --- 81,91 ----
char displayname[100] = "unix";
char client_display[100];
+ #ifdef macII
+ char *default_server = "XmacII";
+ #else
char *default_server = "X";
+ #endif
char *default_display = ":0"; /* choose most efficient */
char *default_client[] = {"xterm", "-geometry", "+1+1", "-n",
"login", "-display", NULL};
char *serverargv[100];
***************
*** 120,129 ****
- --- 124,145 ----
#endif
}
+ #ifdef macII
+ /*
+ * Under A/UX the server appears to execute far enough to send SIGUSR1
+ * BEFORE this xinit parent process returns from forking. When xinit
+ * finally gets to pause(), SIGUSR1 is history. So we keep some state ...
+ */
+ int sigUsr1seen = 0;
+ #endif
+
void
sigUsr1(sig)
int sig;
{
+ #ifdef macII
+ sigUsr1seen = 1;
+ #endif
#ifdef SYSV
signal (sig, sigUsr1);
#endif
***************
*** 163,169 ****
- --- 179,189 ----
* copy the client args.
*/
if (argc == 0 ||
+ #ifdef macII
+ (**argv != '/' && **argv != '.' && !isalpha(**argv))) {
+ #else
(**argv != '/' && **argv != '.')) {
+ #endif
for (ptr = default_client; *ptr; )
*cptr++ = *ptr++;
strcpy(client_display, displayname);
***************
*** 197,203 ****
- --- 217,227 ----
* Copy the server args.
*/
if (argc == 0 ||
+ #ifdef macII
+ (**argv != '/' && **argv != '.' && !isalpha(**argv))) {
+ #else
(**argv != '/' && **argv != '.')) {
+ #endif
*sptr++ = default_server;
} else {
server_given = 1;
***************
*** 282,295 ****
- --- 306,332 ----
/*
* Start the server and client.
*/
+ #ifdef macII
+ signal(SIGQUIT, SIG_IGN);
+ signal(SIGINT, SIG_IGN);
+ signal(SIGHUP, SIG_IGN);
+ signal(SIGPIPE, SIG_IGN);
+ #else
signal(SIGQUIT, sigCatch);
signal(SIGINT, sigCatch);
signal(SIGHUP, sigCatch);
signal(SIGPIPE, sigCatch);
+ #endif
signal(SIGALRM, sigAlarm);
signal(SIGUSR1, sigUsr1);
if ((serverpid = startServer(server)) > 0
&& (clientpid = startClient(client)) > 0) {
+ #ifdef macII
+ signal(SIGQUIT, sigCatch);
+ signal(SIGINT, sigCatch);
+ signal(SIGHUP, sigCatch);
+ signal(SIGPIPE, sigCatch);
+ #endif
pid = -1;
while (pid != clientpid && pid != serverpid)
pid = wait(NULL);
***************
*** 446,454 ****
- --- 483,499 ----
* If your machine is substantially slower than 15 seconds,
* you can easily adjust this value.
*/
+ #ifdef macII
+ if (!sigUsr1seen) {
+ alarm (15);
+ pause ();
+ alarm (0);
+ }
+ #else
alarm (15);
pause ();
alarm (0);
+ #endif
if (waitforserver(serverpid) == 0) {
Error("unable to connect to X server\r\n");