Add logging and repmgr command sanity checks

This commit is contained in:
Ian Barwick
2017-04-20 00:32:04 +09:00
parent 76e8c4624e
commit 8968cfe735
10 changed files with 745 additions and 11 deletions

View File

@@ -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;
}