Changeset - r27173:96f6464052be
[Not reviewed]
master
0 1 0
Rubidium - 17 months ago 2023-04-19 20:15:20
rubidium@openttd.org
Codechange: use Debug over printf for dedicated forking output
1 file changed with 3 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/dedicated.cpp
Show inline comments
 
@@ -9,6 +9,7 @@
 

	
 
#include "stdafx.h"
 
#include "fileio_func.h"
 
#include "debug.h"
 
#include <string>
 

	
 
std::string _log_file; ///< File to reroute output of a forked OpenTTD to
 
@@ -20,15 +21,6 @@ std::unique_ptr<FILE, FileDeleter> _log_
 

	
 
#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()
 
{
 
	/* Fork the program */
 
@@ -59,8 +51,8 @@ void DedicatedFork()
 

	
 
		default:
 
			/* We're the parent */
 
			printf("Loading dedicated server...\n");
 
			printf("  - Forked to background with pid " PRINTF_PID_T "\n", pid);
 
			Debug(net, 0, "Loading dedicated server...");
 
			Debug(net, 0, "  - Forked to background with pid {}", pid);
 
			exit(0);
 
	}
 
}
0 comments (0 inline, 0 general)