identation and minor failure condition fix

This commit is contained in:
2019-01-07 01:10:22 +02:00
parent 63e2cfa9a4
commit 3f1a49704f
2 changed files with 28 additions and 26 deletions

View File

@@ -430,6 +430,7 @@ static int test_conf_syntax(char *config)
} else } else
log(ERROR, "Unknown config entry on line %d: %s", log(ERROR, "Unknown config entry on line %d: %s",
j, buf); j, buf);
failed = 1;
if (!ok) { if (!ok) {
log(ERROR, log(ERROR,
"Invalid value for \"%s\", line %d: \"%s\"", "Invalid value for \"%s\", line %d: \"%s\"",

View File

@@ -74,34 +74,35 @@ int main(int argc, char *argv[])
}; };
int opt = 0, opt_index = 0, fork_flag = 0; int opt = 0, opt_index = 0, fork_flag = 0;
char *config = NULL; char *config = NULL;
while ((opt = getopt_long(argc, argv, opts_short, opts_long, &opt_index)) != -1) { while ((opt = getopt_long(argc, argv, opts_short, opts_long,
&opt_index)) != -1) {
switch (opt) { switch (opt) {
case 0: case 0:
if (opts_long[opt_index].flag != 0) { if (opts_long[opt_index].flag != 0) {
break;
}
log(INFO, "option %s", opts_long[opt_index].name);
if (optarg)
log(INFO, "with arg %s\n", optarg);
break; break;
case 'd': }
fork_flag = 1; log(INFO, "option %s", opts_long[opt_index].name);
break; if (optarg)
case 'c': log(INFO, "with arg %s\n", optarg);
config = optarg; break;
break; case 'd':
case 'h': fork_flag = 1;
usage(argv[0]); break;
exit(EXIT_SUCCESS); case 'c':
case 't': config = optarg;
task = TEST; break;
break; case 'h':
case 'T': usage(argv[0]);
task = TEST_AND_EXPORT; exit(EXIT_SUCCESS);
break; case 't':
default: task = TEST;
usage(argv[0]); break;
exit(EXIT_FAILURE); case 'T':
task = TEST_AND_EXPORT;
break;
default:
usage(argv[0]);
exit(EXIT_FAILURE);
} }
} }