output: verify stream status when closing files

Includes also closing stdout and stderr at the end of execution.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-03-22 21:35:25 +01:00
parent 97e5b59b78
commit 3ef5d6c07f
4 changed files with 39 additions and 4 deletions

View file

@ -197,7 +197,7 @@ int output_txt(void)
warn("output_txt: fflush");
}
} else {
ret = fclose(outfile);
ret = close_stream(outfile);
if (ret) {
warn("output_txt: fclose");
}
@ -304,7 +304,7 @@ int output_xml(void)
warn("output_xml: fflush");
}
} else {
ret = fclose(outfile);
ret = close_stream(outfile);
if (ret) {
warn("output_xml: fclose");
}
@ -633,7 +633,7 @@ int output_html(void)
warn("output_html: fflush");
}
} else {
ret = fclose(outfile);
ret = close_stream(outfile);
if (ret) {
warn("output_html: fclose");
}
@ -781,7 +781,7 @@ int output_csv(void)
warn("output_cvs: fflush");
}
} else {
ret = fclose(outfile);
ret = close_stream(outfile);
if (ret) {
warn("output_cvs: fclose");
}