]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
sys: write significant engine and QC errors to stderr
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 424b0729c56f8307ccf2c784cd7e0d53a0c7ee29..2bfd6912c239084b2645b0b8a13b9beec4dd6670 100644 (file)
--- a/host.c
+++ b/host.c
@@ -89,6 +89,10 @@ void Host_Error (const char *error, ...)
        static char hosterrorstring2[MAX_INPUTLINE]; // THREAD UNSAFE
        static qbool hosterror = false;
        va_list argptr;
+       int outfd = sys.outfd;
+
+       // set output to stderr
+       sys.outfd = fileno(stderr);
 
        // turn off rcon redirect if it was active when the crash occurred
        // to prevent loops when it is a networking problem
@@ -141,6 +145,9 @@ void Host_Error (const char *error, ...)
 
        hosterror = false;
 
+       // restore configured outfd
+       sys.outfd = outfd;
+
        Host_AbortCurrentFrame();
 }