--- gvpe/src/gvpe.C 2005/03/23 21:55:39 1.5 +++ gvpe/src/gvpe.C 2005/04/08 16:12:49 1.7 @@ -104,17 +104,13 @@ int r; int option_index = 0; - while ((r = getopt_long (argc, argv, "-c:DLl:", long_options, &option_index)) != EOF) + while ((r = getopt_long (argc, argv, "c:DLl:", long_options, &option_index)) != EOF) { switch (r) { case 0: /* long option */ break; - case 1: /* this node name */ - thisnode = strdup (optarg); - break; - case 'c': /* config file */ confbase = strdup (optarg); break; @@ -199,7 +195,7 @@ act.sa_handler = sighup_handler; sigaction (SIGHUP , &act, NULL); act.sa_handler = sigusr1_handler; sigaction (SIGUSR1, &act, NULL); act.sa_handler = sigusr2_handler; sigaction (SIGUSR2, &act, NULL); -// act.sa_handler = SIG_IGN; sigaction (SIGCHLD, &act, NULL); + act.sa_handler = SIG_IGN; sigaction (SIGCHLD, &act, NULL); act.sa_handler = SIG_IGN; sigaction (SIGPIPE, &act, NULL); act.sa_flags = SA_RESETHAND; act.sa_handler = sigterm_handler; sigaction (SIGINT , &act, NULL); @@ -221,6 +217,9 @@ parse_options (argc, argv, envp); + argc -= optind; + argv += optind; + if (show_version) { printf (_("%s version %s (built %s %s, protocol %d.%d)\n"), get_identity (), @@ -249,7 +248,15 @@ slog (L_ERR, _("system call `%s' failed: %s"), "mlockall", strerror (errno)); #endif - conf.read_config (true); + if (argc >= 1) + { + thisnode = *argv++; + argc--; + } + + { + configuration_parser (conf, true, argc, argv); + } set_loglevel (llevel != L_NONE ? llevel : conf.llevel);