aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/process-includes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-kbdc/process-includes.c')
-rw-r--r--src/mds-kbdc/process-includes.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mds-kbdc/process-includes.c b/src/mds-kbdc/process-includes.c
index 18d995f..2faaf3f 100644
--- a/src/mds-kbdc/process-includes.c
+++ b/src/mds-kbdc/process-includes.c
@@ -135,7 +135,7 @@ static int transfer_errors(mds_kbdc_parsed_t* restrict subresult, mds_kbdc_tree_
free(errors);
return 0;
- pfail:
+ fail:
saved_errno = errno;
while (errors_ptr--)
mds_kbdc_parse_error_free(errors[errors_ptr]);
@@ -223,7 +223,7 @@ static int process_include(mds_kbdc_tree_include_t* restrict tree)
mds_kbdc_parsed_destroy(&subresult);
return 0;
- pfail:
+ fail:
saved_errno = errno;
free(dirname);
free(cwd);
@@ -242,8 +242,7 @@ static int process_include(mds_kbdc_tree_include_t* restrict tree)
*/
static int process_includes_in_tree(mds_kbdc_tree_t* restrict tree)
{
-#define p(expr) if ((r = process_includes_in_tree(tree->expr))) return r
- int r;
+#define p(expr) fail_if (process_includes_in_tree(tree->expr))
again:
if (tree == NULL)
return 0;
@@ -257,8 +256,7 @@ static int process_includes_in_tree(mds_kbdc_tree_t* restrict tree)
case C(FOR): p (for_.inner); break;
case C(IF): p (if_.inner); p (if_.otherwise); break;
case C(INCLUDE):
- if ((r = process_include(&(tree->include))))
- return r;
+ fail_if (process_include(&(tree->include)));
break;
default:
break;
@@ -266,6 +264,8 @@ static int process_includes_in_tree(mds_kbdc_tree_t* restrict tree)
tree = tree->next;
goto again;
+ fail:
+ return -1;
#undef p
}
@@ -290,7 +290,7 @@ int process_includes(mds_kbdc_parsed_t* restrict result_)
{
struct stat* old;
if (xxrealloc(old, included, included_size += 4, struct stat))
- return included = old, -1;
+ fail_if (included = old, 1);
}
for (i = 0; i < included_ptr; i++)
@@ -309,7 +309,7 @@ int process_includes(mds_kbdc_parsed_t* restrict result_)
free(included), included_size = 0;
return errno = saved_errno, r;
- pfail:
+ fail:
return -1;
}