[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] tests: close files in glr-regression
From: |
Theophile Ranquet |
Subject: |
[PATCH 6/6] tests: close files in glr-regression |
Date: |
Mon, 12 Nov 2012 16:05:34 +0000 |
* tests/glr-regression.at: Here.
---
tests/glr-regression.at | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/tests/glr-regression.at b/tests/glr-regression.at
index 7df17b6..6ca021f 100644
--- a/tests/glr-regression.at
+++ b/tests/glr-regression.at
@@ -196,8 +196,12 @@ int
main (int argc, char **argv)
{
input = stdin;
- if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3;
- return yyparse ();
+ if (argc == 2 && !(input = fopen (argv[1], "r")))
+ return 3;
+ int res = yyparse ();
+ if (argc == 2 && fclose (input))
+ return 4;
+ return res;
}
]])
AT_BISON_OPTION_POPDEFS
@@ -324,8 +328,12 @@ int
main(int argc, char* argv[])
{
input = stdin;
- if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3;
- return yyparse ();
+ if (argc == 2 && !(input = fopen (argv[1], "r")))
+ return 3;
+ int res = yyparse ();
+ if (argc == 2 && fclose (input))
+ return 4;
+ return res;
}
]])
AT_BISON_OPTION_POPDEFS
--
1.7.11.4
- [PATCH 1/6] output: capitalize State, (continued)
- [PATCH 1/6] output: capitalize State, Theophile Ranquet, 2012/11/12
- [PATCH 2/6] xml: documentation, Theophile Ranquet, 2012/11/12
- [PATCH 3/6] graph: fix a memory leak, Theophile Ranquet, 2012/11/12
- [PATCH 4/6] xml: factor xslt space template, Theophile Ranquet, 2012/11/12
- [PATCH 5/6] xml: match DOT output and xml2dot.xsl processing, Theophile Ranquet, 2012/11/12
- [PATCH 6/6] tests: close files in glr-regression,
Theophile Ranquet <=
- Re: [PATCH 0/6] {maint} xslt and other improvements, Akim Demaille, 2012/11/12