.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
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
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;
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;
case 'r':
remove_service_set++;
break;
-#else
+#endif
case 's':
- flags |= EMPTH_PRINT | EMPTH_STACKCHECK;
- daemonize = 0;
+ flags |= EMPTH_STACKCHECK;
break;
-#endif
case 'h':
default:
print_usage(argv[0]);
#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);
}