Failure to do this may result in a crash on shutdown when started
in debug mode.
if (Config->cmdline.forcedebug)
{
- FileWriter* fw = new FileWriter(stdout, 1);
+ FILE* newstdout = fdopen(dup(STDOUT_FILENO), "w");
+ FileWriter* fw = new FileWriter(newstdout, 1);
FileLogStream* fls = new FileLogStream(LOG_RAWIO, fw);
Logs->AddLogTypes("*", fls, true);
}
#define popen _popen
#define pclose _pclose
#define getpid _getpid
+#define dup _dup
+#define fdopen _fdopen
// warning: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
// Normally, this is a huge problem, but due to our new/delete remap, we can ignore it.