about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-11-12 02:59:02 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-11-12 02:59:02 +0000
commitc54d314b6caa9a07d2e571b434ae4d0d7cbd7d89 (patch)
treecaa6f1bb245bc3d2ebbacca75dc7aea9226b1b20 /converter
parent5960a10db4c86aa549862b7e82a6922c9b5a357d (diff)
downloadnetpbm-mirror-c54d314b6caa9a07d2e571b434ae4d0d7cbd7d89.tar.gz
netpbm-mirror-c54d314b6caa9a07d2e571b434ae4d0d7cbd7d89.tar.xz
netpbm-mirror-c54d314b6caa9a07d2e571b434ae4d0d7cbd7d89.zip
Release 10.64.02
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2032 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r--converter/other/pnmtops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 1cf23be7..a523a4f1 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -2026,6 +2026,13 @@ main(int argc, const char * argv[]) {
         name = strdup("noname");
     else
         name = basebasename(cmdline.inputFileName);
+
+    /* This program manages file descriptors in a way that assumes
+       that new files will get file descriptor numbers less than 10,
+       so we close superfluous files now to make sure that's true.
+    */
+    closeAllBut(fileno(ifP), fileno(stdout), fileno(stdout));
+
     {
         int eof;  /* There are no more images in the input file */
         unsigned int imageSeq;