(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
|
||||
.B \-d
|
||||
Debug mode. This will prevent the server from forking itself into the
|
||||
background. It will also make the server abort when it detects an
|
||||
internal error. You normally want to use this flag if you are running
|
||||
background. It will also make it abort when it detects an internal
|
||||
error. You normally want to use this flag if you are running
|
||||
.I emp_server
|
||||
from within a debugger.
|
||||
.TP
|
||||
|
@ -36,13 +36,10 @@ from within a debugger.
|
|||
Help. Print a usage line showing the command line options.
|
||||
.TP
|
||||
.B \-p
|
||||
Lwp Print mode. This is used for debugging lwp-threads.
|
||||
This option automatically sets -d option.
|
||||
Threading debug mode. Implies -d.
|
||||
.TP
|
||||
.B \-s
|
||||
Lwp stack check mode. This will report if any of the lwp thread stack
|
||||
spaces overflow. It forces lwp print mode on.
|
||||
This option automatically sets -d option.
|
||||
Enable thread stack checking.
|
||||
.TP
|
||||
.BI \-D " datadir"
|
||||
causes the server to use the data files in
|
||||
|
|
|
@ -113,11 +113,12 @@ main(int argc, char **argv)
|
|||
char *config_file = NULL;
|
||||
int op;
|
||||
|
||||
#if defined(_WIN32)
|
||||
while ((op = getopt(argc, argv, "D:de:iI:rR:hp")) != EOF) {
|
||||
#ifdef _WIN32
|
||||
# define XOPTS "iI:rR:"
|
||||
#else
|
||||
while ((op = getopt(argc, argv, "D:de:psh")) != EOF) {
|
||||
# define XOPTS
|
||||
#endif
|
||||
while ((op = getopt(argc, argv, "D:de:psh" XOPTS)) != EOF) {
|
||||
switch (op) {
|
||||
case 'D':
|
||||
datadir = optarg;
|
||||
|
@ -125,17 +126,16 @@ main(int argc, char **argv)
|
|||
datadir_set++;
|
||||
#endif
|
||||
break;
|
||||
case 'p':
|
||||
flags |= EMPTH_PRINT;
|
||||
/* fall through */
|
||||
case 'd':
|
||||
debug++;
|
||||
debug = 1;
|
||||
daemonize = 0;
|
||||
break;
|
||||
case 'e':
|
||||
config_file = optarg;
|
||||
break;
|
||||
case 'p':
|
||||
flags |= EMPTH_PRINT;
|
||||
daemonize = 0;
|
||||
break;
|
||||
#if defined(_WIN32)
|
||||
case 'I':
|
||||
service_name = optarg;
|
||||
|
@ -153,12 +153,10 @@ main(int argc, char **argv)
|
|||
case 'r':
|
||||
remove_service_set++;
|
||||
break;
|
||||
#else
|
||||
case 's':
|
||||
flags |= EMPTH_PRINT | EMPTH_STACKCHECK;
|
||||
daemonize = 0;
|
||||
break;
|
||||
#endif
|
||||
case 's':
|
||||
flags |= EMPTH_STACKCHECK;
|
||||
break;
|
||||
case 'h':
|
||||
default:
|
||||
print_usage(argv[0]);
|
||||
|
@ -169,12 +167,12 @@ main(int argc, char **argv)
|
|||
#if defined(_WIN32)
|
||||
if ((debug || flags || datadir_set || config_file != NULL) &&
|
||||
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");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
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");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue