Changeset: 958c7e9880a1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=958c7e9880a1
Modified Files:
common/stream/stream.c
Branch: Jun2016
Log Message:
Only flush stream before closing it if it is writable.
diffs (23 lines):
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -1539,8 +1539,8 @@ stream_xzclose(stream *s)
if (fwrite(xz->buf, 1, sz, xz->fp) != sz)
s->errnr = MNSTR_WRITE_ERROR;
}
+ fflush(xz->fp);
}
- fflush(xz->fp);
fclose(xz->fp);
lzma_end(&xz->strm);
free(xz);
@@ -3236,7 +3236,8 @@ ic_close(stream *s)
struct icstream *ic = (struct icstream *) s->stream_data.p;
if (ic) {
- ic_flush(s);
+ if (ic->access == ST_WRITE)
+ ic_flush(s);
iconv_close(ic->cd);
mnstr_close(ic->s);
mnstr_destroy(ic->s);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list