hangup() cleanup; SIGXCPU handling

This commit is contained in:
nethack.rankin
2007-01-09 05:29:17 +00:00
parent 1c20fe6223
commit f2d8a53718
7 changed files with 60 additions and 49 deletions

View File

@@ -178,7 +178,7 @@ done_hangup(sig) /* signal() handler */
int sig;
{
program_state.done_hup++;
(void)signal(SIGHUP, SIG_IGN);
sethanguphandler((void FDECL((*),(int)))SIG_IGN);
done_intr(sig);
return;
}
@@ -662,7 +662,7 @@ die:
(void) signal(SIGINT, (SIG_RET_TYPE) done_intr);
# if defined(UNIX) || defined(VMS) || defined (__EMX__)
(void) signal(SIGQUIT, (SIG_RET_TYPE) done_intr);
(void) signal(SIGHUP, (SIG_RET_TYPE) done_hangup);
sethanguphandler(done_hangup);
# endif
#endif /* NO_SIGNAL */
@@ -1034,6 +1034,11 @@ int status;
dlb_cleanup();
}
#ifdef VMS
/* don't call exit() if already executing within an exit handler;
that would cancel any other pending user-mode handlers */
if (program_state.exiting) return;
#endif
nethack_exit(status);
}