MCPcopy Create free account
hub / github.com/NetHack/NetHack / byebye

Function byebye

sys/vms/vmsmain.c:391–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391static void
392byebye(void)
393{
394 void (*hup)(int);
395#ifdef SHELL
396 extern unsigned long dosh_pid, mail_pid;
397#ifndef VMSVSI
398 extern unsigned long sys$delprc(unsigned long *, const genericptr_t);
399#endif
400
401 /* clean up any subprocess we've spawned that may still be hanging around
402 */
403 if (dosh_pid)
404 (void) sys$delprc(&dosh_pid, (genericptr_t) 0), dosh_pid = 0;
405 if (mail_pid)
406 (void) sys$delprc(&mail_pid, (genericptr_t) 0), mail_pid = 0;
407#endif
408#ifdef FREE_ALL_MEMORY
409 if (progname && !program_state.panicking) {
410 if (gh.hname == progname)
411 gh.hname = (char *) 0;
412 free((genericptr_t) progname), progname = (char *) 0;
413 }
414#endif
415
416 /* SIGHUP doesn't seem to do anything on VMS, so we fudge it here... */
417 hup = (void (*)(int)) signal(SIGHUP, SIG_IGN);
418 if (!program_state.exiting++
419 && hup != (void (*)(int)) SIG_DFL
420 && hup != (void (*)(int)) SIG_IGN) {
421 (*hup)(SIGHUP);
422 }
423
424#ifdef CHDIR
425 (void) chdir(getenv("PATH"));
426#endif
427}
428
429#ifndef SAVE_ON_FATAL_ERROR
430/* Condition handler to prevent byebye's hangup simulation

Callers

nothing calls this directly

Calls 1

chdirFunction · 0.50

Tested by

no test coverage detected