- if (log->log_gz_store)
- fwrite(ic->buf, ic->len, 1, f);
- else
- flush_chunk(ic, log->log_gz_store, f, &stream, &iter);
+ if (log->log_gz_store) {
+ size_t ret;
+
+ dprint(FD_COMPRESS, "log write chunk size=%lu, "
+ "seq=%u\n", (unsigned long) ic->len, ic->seq);
+
+ ret = fwrite(ic->buf, ic->len, 1, f);
+ if (ret != 1 || ferror(f)) {
+ iter.err = errno;
+ log_err("fio: error writing compressed log\n");
+ }
+ } else
+ inflate_chunk(ic, log->log_gz_store, f, &stream, &iter);