diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-09 13:15:10 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-09 13:15:10 +0100 |
commit | 7a994c9631c590d6a73c842fa5d2d3567b4771dd (patch) | |
tree | 228ade01f99ba217151a0ed20f29c5f3a5028619 /src/mds-kbdc/process-includes.c | |
parent | mds-kbdc: compile-layout: macro_call: fix bug: do not duplicate the arguments if there are none (diff) | |
parent | report an error, rather than causing failure the caller but not for the called function (diff) | |
download | mds-7a994c9631c590d6a73c842fa5d2d3567b4771dd.tar.gz mds-7a994c9631c590d6a73c842fa5d2d3567b4771dd.tar.bz2 mds-7a994c9631c590d6a73c842fa5d2d3567b4771dd.tar.xz |
merge track-errors and resolve conflict
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/process-includes.c | 16 |
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; } |