-void push_error_list(struct errlist ** errors, char * msg){
- struct errlist *err_lst_tmp;
-
- err_lst_tmp = calloc (1, sizeof (struct errlist) );
- if (err_lst_tmp == NULL) {
- fprintf(stderr, "%s: calloc: %s\n", __FUNCTION__, strerror(errno));
- return;
- }
-
- err_lst_tmp->errmsg = strdup(msg);
- if (err_lst_tmp->errmsg == NULL) {
- fprintf(stderr, "%s: strdup: %s\n", __FUNCTION__, strerror(errno));
- free(err_lst_tmp);
- return;
- }
-
- err_lst_tmp->next = *errors;
- *errors = err_lst_tmp;
+void push_error_list(char * msg)
+{
+ struct errlist *e;
+
+ e = xcalloc(1, sizeof(struct errlist));
+ e->errmsg = xstrdup(msg);
+ e->next = NULL;
+
+ if (error_list_head) {
+ error_list_tail->next = e;
+ error_list_tail = e;
+ } else {
+ error_list_head = error_list_tail = e;
+ }