- while((r = getopt_long(argc, argv, "c:DLd::k::n:K::", long_options, &option_index)) != EOF) {
- switch (r) {
- case 0: /* long option */
- break;
-
- case 'c': /* config file */
- confbase = xstrdup(optarg);
- break;
-
- case 'D': /* no detach */
- do_detach = false;
- break;
-
- case 'L': /* no detach */
- do_mlock = true;
- break;
-
- case 'd': /* inc debug level */
- if(optarg)
- debug_level = atoi(optarg);
- else
- debug_level++;
- break;
-
- case 'k': /* kill old tincds */
- if(optarg) {
- if(!strcasecmp(optarg, "HUP"))
- kill_tincd = SIGHUP;
- else if(!strcasecmp(optarg, "TERM"))
- kill_tincd = SIGTERM;
- else if(!strcasecmp(optarg, "KILL"))
- kill_tincd = SIGKILL;
- else if(!strcasecmp(optarg, "USR1"))
- kill_tincd = SIGUSR1;
- else if(!strcasecmp(optarg, "USR2"))
- kill_tincd = SIGUSR2;
- else if(!strcasecmp(optarg, "WINCH"))
- kill_tincd = SIGWINCH;
- else if(!strcasecmp(optarg, "INT"))
- kill_tincd = SIGINT;
- else if(!strcasecmp(optarg, "ALRM"))
- kill_tincd = SIGALRM;
- else {
- kill_tincd = atoi(optarg);
-
- if(!kill_tincd) {
- fprintf(stderr, _("Invalid argument `%s'; SIGNAL must be a number or one of HUP, TERM, KILL, USR1, USR2, WINCH, INT or ALRM.\n"),
- optarg);
- usage(true);
- }
- }
- } else
- kill_tincd = SIGTERM;
- break;