From 02f439ffe8745e3717a2404cbc04ae44b59f4f9e Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 12 Dec 2007 15:27:55 +0000 Subject: [PATCH] abort if preprocessing fails [r18715] --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 2790e01..7df2b42 100644 --- a/main.c +++ b/main.c @@ -595,7 +595,10 @@ int main(int argc, char **argv) FILE *preprocessed_in = preprocess(in, input); translation_unit_t *const unit = do_parsing(preprocessed_in, input); - pclose(preprocessed_in); + int result = pclose(preprocessed_in); + if(result != 0) { + return result; + } if(unit == NULL) { /* parsing failed because of errors */ fprintf(stderr, "%u error(s), %u warning(s)\n", error_count, warning_count); -- 2.20.1