(main): Fix -p to imply -d as documented, not just !daemonize.
(main): -s no longer implies -p. (main) [_WIN32]: Recognize -s. ntthread.c ignores it.
This commit is contained in:
parent
a6b5b1d567
commit
3939741d65
2 changed files with 17 additions and 22 deletions
|
@ -27,8 +27,8 @@ pages within the game.
|
||||||
.TP
|
.TP
|
||||||
.B \-d
|
.B \-d
|
||||||
Debug mode. This will prevent the server from forking itself into the
|
Debug mode. This will prevent the server from forking itself into the
|
||||||
background. It will also make the server abort when it detects an
|
background. It will also make it abort when it detects an internal
|
||||||
internal error. You normally want to use this flag if you are running
|
error. You normally want to use this flag if you are running
|
||||||
.I emp_server
|
.I emp_server
|
||||||
from within a debugger.
|
from within a debugger.
|
||||||
.TP
|
.TP
|
||||||
|
@ -36,13 +36,10 @@ from within a debugger.
|
||||||
Help. Print a usage line showing the command line options.
|
Help. Print a usage line showing the command line options.
|
||||||
.TP
|
.TP
|
||||||
.B \-p
|
.B \-p
|
||||||
Lwp Print mode. This is used for debugging lwp-threads.
|
Threading debug mode. Implies -d.
|
||||||
This option automatically sets -d option.
|
|
||||||
.TP
|
.TP
|
||||||
.B \-s
|
.B \-s
|
||||||
Lwp stack check mode. This will report if any of the lwp thread stack
|
Enable thread stack checking.
|
||||||
spaces overflow. It forces lwp print mode on.
|
|
||||||
This option automatically sets -d option.
|
|
||||||
.TP
|
.TP
|
||||||
.BI \-D " datadir"
|
.BI \-D " datadir"
|
||||||
causes the server to use the data files in
|
causes the server to use the data files in
|
||||||
|
|
|
@ -113,11 +113,12 @@ main(int argc, char **argv)
|
||||||
char *config_file = NULL;
|
char *config_file = NULL;
|
||||||
int op;
|
int op;
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#ifdef _WIN32
|
||||||
while ((op = getopt(argc, argv, "D:de:iI:rR:hp")) != EOF) {
|
# define XOPTS "iI:rR:"
|
||||||
#else
|
#else
|
||||||
while ((op = getopt(argc, argv, "D:de:psh")) != EOF) {
|
# define XOPTS
|
||||||
#endif
|
#endif
|
||||||
|
while ((op = getopt(argc, argv, "D:de:psh" XOPTS)) != EOF) {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 'D':
|
case 'D':
|
||||||
datadir = optarg;
|
datadir = optarg;
|
||||||
|
@ -125,17 +126,16 @@ main(int argc, char **argv)
|
||||||
datadir_set++;
|
datadir_set++;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
flags |= EMPTH_PRINT;
|
||||||
|
/* fall through */
|
||||||
case 'd':
|
case 'd':
|
||||||
debug++;
|
debug = 1;
|
||||||
daemonize = 0;
|
daemonize = 0;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
config_file = optarg;
|
config_file = optarg;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
|
||||||
flags |= EMPTH_PRINT;
|
|
||||||
daemonize = 0;
|
|
||||||
break;
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
case 'I':
|
case 'I':
|
||||||
service_name = optarg;
|
service_name = optarg;
|
||||||
|
@ -153,12 +153,10 @@ main(int argc, char **argv)
|
||||||
case 'r':
|
case 'r':
|
||||||
remove_service_set++;
|
remove_service_set++;
|
||||||
break;
|
break;
|
||||||
#else
|
|
||||||
case 's':
|
|
||||||
flags |= EMPTH_PRINT | EMPTH_STACKCHECK;
|
|
||||||
daemonize = 0;
|
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
case 's':
|
||||||
|
flags |= EMPTH_STACKCHECK;
|
||||||
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
|
@ -169,12 +167,12 @@ main(int argc, char **argv)
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if ((debug || flags || datadir_set || config_file != NULL) &&
|
if ((debug || flags || datadir_set || config_file != NULL) &&
|
||||||
remove_service_set) {
|
remove_service_set) {
|
||||||
fprintf(stderr, "Can't use -p, -d, -D or -e with either "
|
fprintf(stderr, "Can't use -p, -s, -d, -D or -e with either "
|
||||||
"-r or -R options\n");
|
"-r or -R options\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if ((debug || flags) && install_service_set) {
|
if ((debug || flags) && install_service_set) {
|
||||||
fprintf(stderr, "Can't use -d or -p with either "
|
fprintf(stderr, "Can't use -d, -p or -s with either "
|
||||||
"-i or -I options\n");
|
"-i or -I options\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue