mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 00:06:59 +00:00
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:
parent
97e5b59b78
commit
3ef5d6c07f
4 changed files with 39 additions and 4 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue