Don't crash if one specify '-S' or '-s' and an invalid configuration file.
This commit is contained in:
parent
c14fa3c3a9
commit
26f1864c1f
15
src/main.c
15
src/main.c
|
@ -167,21 +167,22 @@ int check_configuration(int dump)
|
||||||
{
|
{
|
||||||
struct hub_config configuration;
|
struct hub_config configuration;
|
||||||
int ret = read_config(arg_config, &configuration, 0);
|
int ret = read_config(arg_config, &configuration, 0);
|
||||||
|
|
||||||
if (dump)
|
if (dump)
|
||||||
{
|
{
|
||||||
dump_config(&configuration, dump > 1);
|
if (ret != -1)
|
||||||
puts("");
|
{
|
||||||
}
|
dump_config(&configuration, dump > 1);
|
||||||
|
}
|
||||||
if (dump)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR\n");
|
fprintf(stderr, "ERROR\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stdout, "OK\n");
|
fprintf(stdout, "OK\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue