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
I_StartupConsole();
#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
I_RegisterSignals();
I_OutputMsg("Compiled for SDL version: %d.%d.%d\n",
@ -1993,9 +1996,10 @@ void I_ShutdownSystem(void)
{
INT32 c;
#ifndef NEWSIGNALHANDLER
I_ShutdownConsole();
#ifdef NEWSIGNALHANDLER
if (M_CheckParm("-nofork"))
#endif
I_ShutdownConsole();
for (c = MAX_QUIT_FUNCS-1; c >= 0; c--)
if (quit_funcs[c])