534 |
*/ |
*/ |
535 |
static void handle_options(int argc, char **argv) { |
static void handle_options(int argc, char **argv) { |
536 |
|
|
537 |
int rval; |
int opt; |
|
char opt; |
|
538 |
|
|
539 |
opterr= 0; |
opterr= 0; |
540 |
|
|
541 |
Run.mygroup=0; |
Run.mygroup=0; |
542 |
|
|
543 |
while((rval= getopt(argc,argv,"c:d:g:l:iIvVh")) != -1) { |
while((opt= getopt(argc,argv,"c:d:g:l:p:iIvVh")) != -1) { |
|
|
|
|
/* Bugfix: char is per default unsigned on arm, powerpc and s390 */ |
|
|
opt= (char) rval; |
|
544 |
|
|
545 |
switch(opt) { |
switch(opt) { |
546 |
|
|
568 |
Run.dolog= TRUE; |
Run.dolog= TRUE; |
569 |
break; |
break; |
570 |
|
|
571 |
|
case 'p': |
572 |
|
Run.pidfile= xstrdup(optarg); |
573 |
|
break; |
574 |
|
|
575 |
case 'i': |
case 'i': |
576 |
Run.validate= TRUE; |
Run.validate= TRUE; |
577 |
break; |
break; |
601 |
case 'd': |
case 'd': |
602 |
case 'g': |
case 'g': |
603 |
case 'l': |
case 'l': |
604 |
|
case 'p': |
605 |
error("%s: option -- %c requires an argument\n", prog, optopt); |
error("%s: option -- %c requires an argument\n", prog, optopt); |
606 |
break; |
break; |
607 |
default: |
default: |
630 |
printf(" -d n Run as a daemon once per n seconds\n"); |
printf(" -d n Run as a daemon once per n seconds\n"); |
631 |
printf(" -g name Set group name for start, stop, restart and status\n"); |
printf(" -g name Set group name for start, stop, restart and status\n"); |
632 |
printf(" -l logfile Print log information to this file\n"); |
printf(" -l logfile Print log information to this file\n"); |
633 |
|
printf(" -p pidfile Use this lock file in daemon mode\n"); |
634 |
printf(" -i Validate mode, startup in validate mode\n"); |
printf(" -i Validate mode, startup in validate mode\n"); |
635 |
printf(" -I Init mode, run from init\n"); |
printf(" -I Init mode, run from init\n"); |
636 |
printf(" -v Verbose mode, work noisy (diagnostic output)\n"); |
printf(" -v Verbose mode, work noisy (diagnostic output)\n"); |