hangup() cleanup; SIGXCPU handling
This commit is contained in:
@@ -122,7 +122,7 @@ char *argv[];
|
||||
/* used to clear hangup stuff while still giving standard traceback */
|
||||
VAXC$ESTABLISH(vms_handler);
|
||||
#endif
|
||||
(void) signal(SIGHUP, (SIG_RET_TYPE) hangup);
|
||||
sethanguphandler(hangup);
|
||||
|
||||
process_options(argc, argv); /* command line options */
|
||||
|
||||
@@ -389,8 +389,8 @@ byebye()
|
||||
extern unsigned long FDECL(sys$delprc,(unsigned long *,const genericptr_t));
|
||||
|
||||
/* clean up any subprocess we've spawned that may still be hanging around */
|
||||
if (dosh_pid) (void) sys$delprc(&dosh_pid, 0), dosh_pid = 0;
|
||||
if (mail_pid) (void) sys$delprc(&mail_pid, 0), mail_pid = 0;
|
||||
if (dosh_pid) (void) sys$delprc(&dosh_pid, (genericptr_t)0), dosh_pid = 0;
|
||||
if (mail_pid) (void) sys$delprc(&mail_pid, (genericptr_t)0), mail_pid = 0;
|
||||
#endif
|
||||
|
||||
/* SIGHUP doesn't seem to do anything on VMS, so we fudge it here... */
|
||||
@@ -429,6 +429,13 @@ genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
sethanguphandler(handler)
|
||||
void FDECL((*handler), (int));
|
||||
{
|
||||
(void)signal(SIGHUP, (SIG_RET_TYPE)handler);
|
||||
}
|
||||
|
||||
#ifdef PORT_HELP
|
||||
void
|
||||
port_help()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)vmstty.c 3.5 2005/11/19 */
|
||||
/* SCCS Id: @(#)vmstty.c 3.5 2007/01/08 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
/* tty.c - (VMS) version */
|
||||
@@ -478,14 +478,15 @@ void
|
||||
error VA_DECL(const char *,s)
|
||||
VA_START(s);
|
||||
VA_INIT(s, const char *);
|
||||
if(settty_needed)
|
||||
|
||||
if (settty_needed)
|
||||
settty((char *)0);
|
||||
Vprintf(s,VA_ARGS);
|
||||
(void) putchar('\n');
|
||||
VA_END();
|
||||
#ifndef SAVE_ON_FATAL_ERROR
|
||||
/* prevent vmsmain's exit handler byebye() from calling hangup() */
|
||||
(void)signal(SIGHUP, SIG_DFL);
|
||||
sethanguphandler((void FDECL((*),(int)))SIG_DFL);
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user