mirror of https://github.com/OpenTTD/OpenTTD
Codechange: use Debug over printf for dedicated forking output
parent
75cd790ab9
commit
fce4b5ea69
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "fileio_func.h"
|
#include "fileio_func.h"
|
||||||
|
#include "debug.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::string _log_file; ///< File to reroute output of a forked OpenTTD to
|
std::string _log_file; ///< File to reroute output of a forked OpenTTD to
|
||||||
|
@ -20,15 +21,6 @@ std::unique_ptr<FILE, FileDeleter> _log_fd; ///< File to reroute output of a for
|
||||||
|
|
||||||
#include "safeguards.h"
|
#include "safeguards.h"
|
||||||
|
|
||||||
#if defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx)
|
|
||||||
/* Solaris has, in certain situation, pid_t defined as long, while in other
|
|
||||||
* cases it has it defined as int... this handles all cases nicely.
|
|
||||||
*/
|
|
||||||
# define PRINTF_PID_T "%ld"
|
|
||||||
#else
|
|
||||||
# define PRINTF_PID_T "%d"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void DedicatedFork()
|
void DedicatedFork()
|
||||||
{
|
{
|
||||||
/* Fork the program */
|
/* Fork the program */
|
||||||
|
@ -59,8 +51,8 @@ void DedicatedFork()
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* We're the parent */
|
/* We're the parent */
|
||||||
printf("Loading dedicated server...\n");
|
Debug(net, 0, "Loading dedicated server...");
|
||||||
printf(" - Forked to background with pid " PRINTF_PID_T "\n", pid);
|
Debug(net, 0, " - Forked to background with pid {}", pid);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue