mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 08:56:29 +00:00
Consolidate error/warning output code
This commit is contained in:
22
config.c
22
config.c
@@ -177,13 +177,9 @@ parse_config(t_configuration_options *options, bool terse)
|
|||||||
|
|
||||||
if (terse == false && config_warnings.head != NULL)
|
if (terse == false && config_warnings.head != NULL)
|
||||||
{
|
{
|
||||||
ItemListCell *cell;
|
|
||||||
|
|
||||||
log_warning(_("the following problems were found in the configuration file:"));
|
log_warning(_("the following problems were found in the configuration file:"));
|
||||||
for (cell = config_warnings.head; cell; cell = cell->next)
|
|
||||||
{
|
print_item_list(&config_warnings);
|
||||||
fprintf(stderr, " %s\n", cell->string);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -651,24 +647,16 @@ reload_config(t_configuration_options *orig_options)
|
|||||||
static void
|
static void
|
||||||
exit_with_config_file_errors(ItemList *config_errors, ItemList *config_warnings, bool terse)
|
exit_with_config_file_errors(ItemList *config_errors, ItemList *config_warnings, bool terse)
|
||||||
{
|
{
|
||||||
ItemListCell *cell;
|
|
||||||
|
|
||||||
|
|
||||||
log_error(_("following errors were found in the configuration file:"));
|
log_error(_("following errors were found in the configuration file:"));
|
||||||
|
|
||||||
for (cell = config_errors->head; cell; cell = cell->next)
|
print_item_list(config_errors);
|
||||||
{
|
|
||||||
fprintf(stderr, " %s\n", cell->string);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (terse == false && config_warnings->head != NULL)
|
if (terse == false && config_warnings->head != NULL)
|
||||||
{
|
{
|
||||||
puts("");
|
puts("");
|
||||||
log_warning(_("the following problems were also found in the configuration file:"));
|
log_warning(_("the following problems were also found in the configuration file:"));
|
||||||
for (cell = config_warnings->head; cell; cell = cell->next)
|
|
||||||
{
|
print_item_list(config_warnings);
|
||||||
fprintf(stderr, " %s\n", cell->string);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
|
|||||||
Reference in New Issue
Block a user