/* $Header: final.c,v 4.3 85/05/01 11:38:08 lwall Exp $
* Revision 4.3 85/05/01 11:38:08 lwall
* Baseline for release with 4.3bsd.
sigset(SIGTSTP
, stop_catcher
); /* job control signals */
sigset(SIGCONT
, cont_catcher
); /* job control signals */
sigset(SIGINT
, int_catcher
); /* always catch interrupts */
sigset(SIGHUP
, sig_catcher
); /* and hangups */
sigset(SIGILL
, sig_catcher
);
sigset(SIGTRAP
, sig_catcher
);
sigset(SIGFPE
, sig_catcher
);
sigset(SIGBUS
, sig_catcher
);
sigset(SIGSEGV
, sig_catcher
);
sigset(SIGSYS
, sig_catcher
);
sigset(SIGTERM
, sig_catcher
);
sigset(SIGXCPU
, sig_catcher
);
sigset(SIGXFSZ
, sig_catcher
);
void /* very much void */
/* come here on interrupt */
sigset(SIGINT
,int_catcher
);
write(2,"int_catcher\n",12);
if (int_count
) { /* was there already an interrupt? */
write(2,"\nBye-bye.\n",10);
sig_catcher(0); /* emulate the other signals */
/* come here on signal other than interrupt, stop, or cont */
static char *signame
[] = {
printf("\nSIG%s--.newsrc not restored in debug\n",signame
[signo
]);
(void) sigset(SIGILL
,SIG_DFL
);
panic
= TRUE
; /* disable terminal I/O */
if (doing_ng
) { /* need we reconstitute rc line? */
restore_ng(); /* then do so (hope this works) */
if (rc_changed
) /* need we write .newsrc out? */
write_rc(); /* then do so */
printf("\nCaught %s%s--.newsrc restored\n",
signo
? "a SIG" : "an internal error", signame
[signo
]);
printf("\nSignal %d--bye bye\n",signo
);
finalize(1); /* and blow up */
/* come here on stop signal */
checkpoint_rc(); /* good chance of crash while stopped */
resetty(); /* this is the point of all this */
write(2,"stop_catcher\n",13);
sigset(SIGTSTP
,SIG_DFL
); /* enable stop */
sigsetmask(sigblock(0) & ~(1 << (SIGTSTP
-1)));
kill(0,SIGTSTP
); /* and do the stop */
sigset(SIGTSTP
,stop_catcher
); /* unenable the stop */
/* come here on cont signal */
sigset(SIGCONT
,cont_catcher
);
mailcount
= 0; /* force recheck */
write(2,"cont_catcher\n",13);
noecho(); /* set no echo */
crmode(); /* set cbreak mode */
forceme("\f"); /* cause a refresh */
/* (defined only if TIOCSTI defined) */