1
0
Fork 0

(svn r9035) -Fix [SunOS]: Solaris sometimes has pid_t defined as long. Fix warnings in those cases

release/0.6
truelight 2007-03-06 21:14:48 +00:00
parent 43133c766c
commit 621ea1d863
1 changed files with 9 additions and 1 deletions

View File

@ -14,6 +14,14 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.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) void DedicatedFork(void)
{ {
/* Fork the program */ /* Fork the program */
@ -47,7 +55,7 @@ void DedicatedFork(void)
default: default:
/* We're the parent */ /* We're the parent */
printf("Loading dedicated server...\n"); printf("Loading dedicated server...\n");
printf(" - Forked to background with pid %d\n", pid); printf(" - Forked to background with pid " PRINTF_PID_T "\n", pid);
exit(0); exit(0);
} }
} }