Browse Source

* fix config test

master
Alex 'AdUser' Z 9 years ago
parent
commit
207bd91bc9
  1. 8
      src/main.c

8
src/main.c

@ -31,7 +31,7 @@ struct {
"", "",
}; };
enum { stop = 0, run, reconfig } state = run; enum { stop = 0, run, reconfig, test } state = run;
void sa_term(int signum) { void sa_term(int signum) {
UNUSED(signum); UNUSED(signum);
@ -112,7 +112,6 @@ update_opts_from_config(f2b_config_section_t *section) {
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
bool config_test = true;
struct sigaction act; struct sigaction act;
f2b_config_t config; f2b_config_t config;
f2b_config_section_t *section = NULL; f2b_config_section_t *section = NULL;
@ -132,6 +131,7 @@ int main(int argc, char *argv[]) {
usage(EXIT_SUCCESS); usage(EXIT_SUCCESS);
break; break;
case 't': case 't':
state = test;
break; break;
default: default:
usage(EXIT_FAILURE); usage(EXIT_FAILURE);
@ -150,8 +150,8 @@ int main(int argc, char *argv[]) {
f2b_log_msg(log_error, "can't load config from '%s'", opts.config_path); f2b_log_msg(log_error, "can't load config from '%s'", opts.config_path);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (config_test) { if (state == test) {
fprintf(stderr, "config test ok"); fprintf(stderr, "config test ok\n");
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
update_opts_from_config(config.main); update_opts_from_config(config.main);

Loading…
Cancel
Save