- fwrite(ic->buf, ic->len, 1, f);
- free_chunk(ic);
+ 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");
+ }