- this->Config->argv = argv;
- this->Config->argc = argc;
-
- this->TIME = this->OLDTIME = this->startup_time = time(NULL);
- srand(this->TIME);
-
- *this->LogFileName = 0;
-
- struct option longopts[] =
- {
- { "nofork", no_argument, &do_nofork, 1 },
- { "logfile", required_argument, NULL, 'f' },
- { "config", required_argument, NULL, 'c' },
- { "debug", no_argument, &do_debug, 1 },
- { "nolog", no_argument, &do_nolog, 1 },
- { "runasroot", no_argument, &do_root, 1 },
- { "version", no_argument, &do_version, 1 },
- { "testsuite", no_argument, &do_testsuite, 1 },
- { 0, 0, 0, 0 }
- };
-
- int index;
- while ((c = getopt_long_only(argc, argv, ":f:", longopts, &index)) != -1)
- {
- switch (c)
- {
- case 'f':
- /* Log filename was set */
- strlcpy(LogFileName, optarg, MAXBUF);
- break;
- case 'c':
- /* Config filename was set */
- ConfigFileName = optarg;
- break;
- case 0:
- /* getopt_long_only() set an int variable, just keep going */
- break;
- case '?':
- /* Unknown parameter */
- default:
- /* Fall through to handle other weird values too */
- printf("Unknown parameter '%s'\n", argv[optind-1]);
- printf("Usage: %s [--nofork] [--nolog] [--debug] [--logfile <filename>]\n%*s[--runasroot] [--version] [--config <config>] [--testsuite]\n", argv[0], static_cast<int>(8+strlen(argv[0])), " ");
- Exit(EXIT_STATUS_ARGV);
- break;
- }
- }
-
- if (do_testsuite)
- do_nofork = do_debug = true;