sdl/i_system.c: add -nofork option to disable forking signal handler

This commit is contained in:
James R 2023-02-14 03:39:51 -08:00
parent 98a4a90129
commit 1d688c3417

View file

@ -1700,7 +1700,10 @@ INT32 I_StartupSystem(void)
#endif #endif
I_StartupConsole(); I_StartupConsole();
#ifdef NEWSIGNALHANDLER #ifdef NEWSIGNALHANDLER
I_Fork(); // This is useful when debugging. It lets GDB attach to
// the correct process easily.
if (!M_CheckParm("-nofork"))
I_Fork();
#endif #endif
I_RegisterSignals(); I_RegisterSignals();
I_OutputMsg("Compiled for SDL version: %d.%d.%d\n", I_OutputMsg("Compiled for SDL version: %d.%d.%d\n",
@ -1993,9 +1996,10 @@ void I_ShutdownSystem(void)
{ {
INT32 c; INT32 c;
#ifndef NEWSIGNALHANDLER #ifdef NEWSIGNALHANDLER
I_ShutdownConsole(); if (M_CheckParm("-nofork"))
#endif #endif
I_ShutdownConsole();
for (c = MAX_QUIT_FUNCS-1; c >= 0; c--) for (c = MAX_QUIT_FUNCS-1; c >= 0; c--)
if (quit_funcs[c]) if (quit_funcs[c])