nasm/output
H. Peter Anvin d0fbb7f0ab Don't fclose() the output in the backend
We fopen() the output file in common code but fclose() it in the
backend.  This is bad for a variety of reasons:

1. it is generally an awkward interface to change ownership.
2. we should use ferror() to test for write errors, and that is
   better done in common code.
3. it requires more code.
4. we still need to fclose() in common code during error handing.

Thus, move the fclose() of the output out of the backends, and add
fflush() so we can test ferror() on output.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-12 12:15:35 -07:00
..
dwarf.h Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
elf32.h Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
elf64.h Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
elfcommon.h Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
nulldbg.c Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
outaout.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outaout.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outas86.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outas86.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outbin.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outbin.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outcoff.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outcoff.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outdbg.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outelf32.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outelf64.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outelf.c Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
outelf.h Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
outelf.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outform.c Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
outform.h macho64: Manually merge macho64 branch with master branch. 2009-07-08 23:04:52 -05:00
outieee.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outlib.c Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
outlib.h Add new copyright headers to the output modules 2009-06-28 17:25:15 -07:00
outmacho32.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outmacho64.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outmacho.mac macho64: Manually merge macho64 branch with master branch. 2009-07-08 23:04:52 -05:00
outobj.c Make it possible for outputs to be either text or binary 2009-07-05 14:45:12 -07:00
outobj.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outrdf2.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outrdf2.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00
outrdf.c Don't fclose() the output in the backend 2009-07-12 12:15:35 -07:00
outrdf.mac NASM: relicense under the 2-clause BSD license 2009-07-06 11:09:11 -07:00