void Host_Quit_f (void)
{
- Sys_Quit ();
+ Sys_Quit (0);
}
// (may) output text to terminal which launched program
void Sys_Shutdown (void); //INFO: This is only called by Host_Shutdown so we dont need testing for recursion
-void Sys_Quit (void);
+void Sys_Quit (int returnvalue);
double Sys_DoubleTime (void);
extern qboolean host_shuttingdown;
-void Sys_Quit (void)
+void Sys_Quit (int returnvalue)
{
host_shuttingdown = true;
Host_Shutdown();
- exit(0);
+ exit(returnvalue);
}
/*
{
printf("Received signal %d, exiting...\n", sig);
VID_RestoreSystemGamma();
- Sys_Quit();
- exit(0);
+ Sys_Quit(1);
}
void InitSig(void)
// Closed
if (AsyncEvent_Quitting)
- Sys_Quit();
+ Sys_Quit(0);
}
static void VID_BuildAGLAttrib(GLint *attrib, qboolean stencil, qboolean fullscreen, qboolean stereobuffer)
VID_AppFocusChanged(false);
break;
case kEventAppQuit:
- Sys_Quit();
+ Sys_Quit(0);
break;
case kEventAppActiveWindowChanged:
break;
break;
case DestroyNotify:
// window has been destroyed
- Sys_Quit();
+ Sys_Quit(0);
break;
case ClientMessage:
// window manager messages
if ((event.xclient.format == 32) && ((unsigned int)event.xclient.data.l[0] == wm_delete_window_atom))
- Sys_Quit();
+ Sys_Quit(0);
break;
case MapNotify:
// window restored
{
Con_Printf("Received signal %d, exiting...\n", sig);
VID_RestoreSystemGamma();
- Sys_Quit();
- exit(0);
+ Sys_Quit(1);
}
void InitSig(void)
void signal_handler(int sig)
{
Con_Printf("Received signal %d, exiting...\n", sig);
- Sys_Quit();
- exit(0);
+ Sys_Quit(1);
}
void InitSig(void)
while( SDL_PollEvent( &event ) )
switch( event.type ) {
case SDL_QUIT:
- Sys_Quit();
+ Sys_Quit(0);
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
{
if (!GetMessage (&msg, NULL, 0, 0))
- Sys_Quit ();
+ Sys_Quit (1);
TranslateMessage (&msg);
DispatchMessage (&msg);
case WM_CLOSE:
if (MessageBox (mainwindow, "Are you sure you want to quit?", "Confirm Exit", MB_YESNO | MB_SETFOREGROUND | MB_ICONQUESTION) == IDYES)
- Sys_Quit ();
+ Sys_Quit (0);
break;