]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
rcon: rewrite variable expansion support, related fixes
[xonotic/darkplaces.git] / sys_shared.c
index 6b5eef4343cce9360a15676626ca2671932fe173..7ce69c3132be521c6173760e6df715c5bc2c6d4e 100644 (file)
 #include "thread.h"
 #include "libcurl.h"
 
-#ifdef WIN32
-       // Microsoft's compiler complains about portable code
-       #pragma warning(disable : 4996)
-#endif
 
 sys_t sys;
 
@@ -60,33 +56,6 @@ char *Sys_TimeString(const char *timeformat)
 }
 
 
-void Sys_Quit (int returnvalue)
-{
-       // Unlock mutexes because the quit command may jump directly here, causing a deadlock
-       if ((cmd_local)->cbuf->lock)
-               Cbuf_Unlock((cmd_local)->cbuf);
-       SV_UnlockThreadMutex();
-       TaskQueue_Frame(true);
-
-       if (Sys_CheckParm("-profilegameonly"))
-               Sys_AllowProfiling(false);
-       host.state = host_shutdown;
-       Host_Shutdown();
-
-#ifdef __ANDROID__
-       Sys_AllowProfiling(false);
-#endif
-
-#ifndef WIN32
-       fcntl(fileno(stdout), F_SETFL, fcntl(fileno(stdout), F_GETFL, 0) & ~O_NONBLOCK);
-       fcntl(fileno(stderr), F_SETFL, fcntl(fileno(stderr), F_GETFL, 0) & ~O_NONBLOCK);
-#endif
-       fflush(stdout);
-       fflush(stderr);
-
-       exit(returnvalue);
-}
-
 #ifdef __cplusplus
 extern "C"
 #endif
@@ -1103,7 +1072,16 @@ int main (int argc, char **argv)
 
        Host_Main();
 
-       Sys_Quit(0);
+#ifdef __ANDROID__
+       Sys_AllowProfiling(false);
+#endif
+
+#ifndef WIN32
+       fcntl(fileno(stdout), F_SETFL, fcntl(fileno(stdout), F_GETFL, 0) & ~O_NONBLOCK);
+       fcntl(fileno(stderr), F_SETFL, fcntl(fileno(stderr), F_GETFL, 0) & ~O_NONBLOCK);
+#endif
+       fflush(stdout);
+       fflush(stderr);
 
        return 0;
 }