mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-28 09:26:29 +00:00
Add logging and repmgr command sanity checks
This commit is contained in:
28
config.c
28
config.c
@@ -22,3 +22,31 @@ progname(void)
|
||||
{
|
||||
return _progname;
|
||||
}
|
||||
|
||||
void
|
||||
item_list_append(ItemList *item_list, char *error_message)
|
||||
{
|
||||
ItemListCell *cell;
|
||||
|
||||
cell = (ItemListCell *) pg_malloc0(sizeof(ItemListCell));
|
||||
|
||||
if (cell == NULL)
|
||||
{
|
||||
//log_err(_("unable to allocate memory; terminating.\n"));
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
cell->string = pg_malloc0(MAXLEN);
|
||||
strncpy(cell->string, error_message, MAXLEN);
|
||||
|
||||
if (item_list->tail)
|
||||
{
|
||||
item_list->tail->next = cell;
|
||||
}
|
||||
else
|
||||
{
|
||||
item_list->head = cell;
|
||||
}
|
||||
|
||||
item_list->tail = cell;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user