Redirect stderr messages to the log file, as in daemon mode assert() failure are silent and make wrong INI file hard to fix.

This commit is contained in:
Daniel Caujolle-Bert
2020-05-09 12:11:08 +02:00
parent 5410ca3ce8
commit c3efabf56c
4 changed files with 20 additions and 7 deletions

View File

@@ -237,7 +237,7 @@ int CMMDVMHost::run()
#endif
#endif
ret = ::LogInitialise(m_conf.getLogFilePath(), m_conf.getLogFileRoot(), m_conf.getLogFileLevel(), m_conf.getLogDisplayLevel());
ret = ::LogInitialise(m_daemon, m_conf.getLogFilePath(), m_conf.getLogFileRoot(), m_conf.getLogFileLevel(), m_conf.getLogDisplayLevel());
if (!ret) {
::fprintf(stderr, "MMDVMHost: unable to open the log file\n");
return 1;
@@ -247,7 +247,6 @@ int CMMDVMHost::run()
if (m_daemon) {
::close(STDIN_FILENO);
::close(STDOUT_FILENO);
::close(STDERR_FILENO);
}
#endif