diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-01-01 20:00:20 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-01-01 20:00:20 +0000 |
commit | 04ef8245da9811cb2d1a76e2f83a78c8837aa324 (patch) | |
tree | 7b9536340cc1fd34f90f2a8196a20f856df09321 | |
parent | a6facd5aa01da8db4a0ce8914704ca1cbaeeade5 (diff) | |
download | netpbm-mirror-04ef8245da9811cb2d1a76e2f83a78c8837aa324.tar.gz netpbm-mirror-04ef8245da9811cb2d1a76e2f83a78c8837aa324.tar.xz netpbm-mirror-04ef8245da9811cb2d1a76e2f83a78c8837aa324.zip |
add comments
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2357 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/other/pamtotiff.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/converter/other/pamtotiff.c b/converter/other/pamtotiff.c index f2cc0e2b..7b645b23 100644 --- a/converter/other/pamtotiff.c +++ b/converter/other/pamtotiff.c @@ -960,6 +960,12 @@ copyBufferToStdout(int const tmpfileFd) { fwrite(buffer, 1, bytesReadCt, stdout); } + /* POSIX lets us create a FILE from an existing file descriptor, but + does not provide a way to destroy the FILE and keep the file + descriptor. The following fclose() closes the file. Caller + must not access the file again, and if he attempts to close it, + must ignore the failure of close + */ fclose(tmpfileP); } @@ -975,6 +981,10 @@ destroyTiffGenerator(WriteMethod const writeMethod, if (writeMethod == TMPFILE) copyBufferToStdout(ofd); + /* If we copied the buffer above, the buffer file is already closed + (copyBufferToStdout closes it), TIFFClose appears to tolerate that - + all it does is a close() and doesn't mind that it fails. + */ TIFFClose(tifP); } |