From: Matthias Braun Date: Wed, 12 Dec 2007 15:27:55 +0000 (+0000) Subject: abort if preprocessing fails X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=02f439ffe8745e3717a2404cbc04ae44b59f4f9e;p=cparser abort if preprocessing fails [r18715] --- 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);