diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 549fdf7bd..e23f155e0 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1923,7 +1923,10 @@ INT32 I_StartupSystem(void) SDL_GetVersion(&SDLlinked); 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 #ifdef HAVE_THREADS I_start_threads(); @@ -2215,9 +2218,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])