[2554] in Athena Bugs
Change to standardize "slide-show" type toeholds.
daemon@ATHENA.MIT.EDU (John D. Kubiatowicz)
Wed Jul 12 22:44:22 1989
To: bugs@ATHENA.MIT.EDU
Cc: probe@ATHENA.MIT.EDU, epeisach@ATHENA.MIT.EDU, sethf@ATHENA.MIT.EDU,
Date: Wed, 12 Jul 89 22:43:37 EDT
From: John D. Kubiatowicz <kubitron@ATHENA.MIT.EDU>
We all enjoy the "slide show" toeholds which are currently running in the
fishbowl. However, as it stands, this requires a special version of
toehold, something which should be avoided. Why? Well, as I discovered
yesterday, the major bug which would occasionally hang parallax consoles
(you know, the cursor flashing in the upper left corner) was a toehold
problem. Not a problem caused by Seth, but something which needed
to be fixed. Thus, this makes a special version of toehold (or any
system software) a maintainance problem.
Thus I propose the following patch to toehold (in addition to other
fixes which have appeared earlier).
Just before toehold prints its standard "Press Any Key to Start" message,
it attempts to execute /etc/athena/deactivate.image. If this file
doesn't exist, or the execution returns a nonzero error, toehold does
its normal thing. Otherwise, it skips directly to the wait-loop code.
Will the releng guys consider this for 6.3B, PLEASE? We can't afford
to keep the buggy toehold in the fishbowl, and we need the slideshow
there also.... Incidentally, I already have a deactivate.image which
provides the same functionality (using sethf's binary in /mit/pictures).
--KUBI--
p.s. I think this will definitely do the trick. BTW, Seth, I have a few
off-line suggestions for your display on the parallax...
*** /tmp/,RCSt1008846 Wed Jul 12 22:31:03 1989
--- /tmp/,RCSt2008846 Wed Jul 12 22:31:04 1989
***************
*** 1,10 ****
/*
* $Source: /afs/athena.mit.edu/mit/plx/src/toehold/RCS/toehold.c,v $
! * $Header: toehold.c,v 1.2 89/07/12 09:21:04 kubitron Exp $
*/
#ifndef lint
! static char *rcsid_toehold_c = "$Header: toehold.c,v 1.2 89/07/12 09:21:04 kubitron Exp $";
#endif lint
#include <stdio.h>
--- 1,10 ----
/*
* $Source: /afs/athena.mit.edu/mit/plx/src/toehold/RCS/toehold.c,v $
! * $Header: toehold.c,v 1.3 89/07/12 22:21:23 kubitron Exp $
*/
#ifndef lint
! static char *rcsid_toehold_c = "$Header: toehold.c,v 1.3 89/07/12 22:21:23 kubitron Exp $";
#endif lint
#include <stdio.h>
***************
*** 61,66 ****
--- 61,67 ----
/* Program names */
static char activate_prog[]="/etc/athena/activate";
static char deactivate_prog[]="/etc/athena/deactivate";
+ static char deactivate_image_prog[] = "/etc/athena/deactivate.image";
static char login_prog[]="/bin/login";
/* Files */
***************
*** 144,161 ****
ioctl (0, TIOCSPGRP, &pgrp); /* Reset the tty pgrp */
#endif
- /* Clear the display and put our message in a random place */
cooked_mode();
#ifdef ibm032
! if (clrwidth == CLRWIDTH_AED)
! MSG("\033L"); /* ESC-L: clear and home */
#endif
! spew(clrheight, '\n');
! srandom(getpid());
! spew(random() % (clrwidth - strlen(message)), ' ');
! MSG(message);
! spew(random() % clrheight, '\n');
! spew(random() % clrwidth, ' ');
/* Wait for the user to type a key */
raw_mode();
--- 145,171 ----
ioctl (0, TIOCSPGRP, &pgrp); /* Reset the tty pgrp */
#endif
cooked_mode();
+ if (!(npid = fork())) { /* Attempt to activate special image */
+ execlp(deactivate_image_prog, deactivate_image_prog, 0);
+ exit(1);
+ }
+ while (wait(&wait_stat) != npid);
+ if (wait_stat.w_retcode) { /* image failed. Do standard display */
+
+ /* Clear the display and put our message in a random place */
+ cooked_mode();
#ifdef ibm032
! if (clrwidth == CLRWIDTH_AED)
! MSG("\033L"); /* ESC-L: clear and home */
#endif
! spew(clrheight, '\n');
! srandom(getpid());
! spew(random() % (clrwidth - strlen(message)), ' ');
! MSG(message);
! spew(random() % clrheight, '\n');
! spew(random() % clrwidth, ' ');
! }
/* Wait for the user to type a key */
raw_mode();