add "nofork" parameter

to disable process forking
might be useful for gdb and perf
This commit is contained in:
Alug committed 2025-05-11 17:11:51 +02:00
1 parent 03fff05f6c
commit d9052fff97
1 file changed
+7 -3
+7 -3
View File
@@ -1941,7 +1941,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();
@@ -2233,9 +2236,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])