From: ellson Date: Tue, 8 Aug 2006 14:34:41 +0000 (+0000) Subject: can't fflush() when using zlib compression. X-Git-Tag: LAST_LIBGRAPH~32^2~5997 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1476e2c474ac70bfc11802345a41be158dc7ac0;p=graphviz can't fflush() when using zlib compression. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 39f141b13..0a9a6fd99 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -2527,7 +2527,7 @@ static void emit_job(GVJ_t * job, graph_t * g) emit_graph(job, g); /* Flush is necessary because we may be writing to a pipe. */ - if (! job->external_surface && job->output_lang != TK) + if (job->output_file && ! job->external_surface && job->output_lang != TK) fflush(job->output_file); } diff --git a/plugin/core/gvrender_core.c b/plugin/core/gvrender_core.c index 2494ab865..796e5a243 100644 --- a/plugin/core/gvrender_core.c +++ b/plugin/core/gvrender_core.c @@ -75,6 +75,7 @@ void core_fini_compression(GVJ_t *job) case COMPRESSION_ZLIB: #ifdef HAVE_LIBZ gzclose((gzFile *) (job->output_file)); + job->output_file = NULL; break; #else (job->common->errorfn) ("No libz support\n");