3d8cc972aeac2f853c867a4b4bbbc1b78ae85c7c kent Fri Sep 5 17:04:21 2014 -0700 Adding new pipelineClose() function that combines pipelineWait and pipelineFree and applying it where it makes sense, in some cases fixing non-symptomatic bugs from missing pipelineWaits diff --git src/lib/textOut.c src/lib/textOut.c index be1c500..9ab111e 100644 --- src/lib/textOut.c +++ src/lib/textOut.c @@ -167,31 +167,30 @@ pipelineFd(compressPipeline), STDOUT_FILENO); } pushWarnHandler(textOutWarnHandler); pushAbortHandler(textOutAbortHandler); return(compressPipeline); } void textOutClose(struct pipeline **pCompressPipeline, int *saveStdout) /* Flush and close stdout, wait for the pipeline to finish, and then free * the pipeline object. */ { if (pCompressPipeline && *pCompressPipeline) { fflush(stdout); close(STDOUT_FILENO); // Do not use fclose - pipelineWait(*pCompressPipeline); - pipelineFree(pCompressPipeline); + pipelineClose(pCompressPipeline); } if (saveStdout) { if (*saveStdout != -1) { /* restore stdout */ fflush(stdout); dup2(*saveStdout,STDOUT_FILENO); /* closes STDOUT before setting it back to saved descriptor */ close(*saveStdout); *saveStdout = -1; } } }