Skip to content

Commit

Permalink
Fix compile problems when compiling without libz support.
Browse files Browse the repository at this point in the history
Don't depend on Bytef as datatype which is a libz invention.
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent 7218af3 commit b40d1ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/filed/compression.c
Expand Up @@ -101,12 +101,12 @@ bool setup_compression_context(b_ctx &bctx)
*/
if ((bctx.ff_pkt->flags & FO_SPARSE) ||
(bctx.ff_pkt->flags & FO_OFFSETS)) {
bctx.chead = (Bytef *)bctx.jcr->compress.buffer + OFFSET_FADDR_SIZE;
bctx.cbuf = (Bytef *)bctx.jcr->compress.buffer + OFFSET_FADDR_SIZE + sizeof(comp_stream_header);
bctx.chead = (uint8_t *)bctx.jcr->compress.buffer + OFFSET_FADDR_SIZE;
bctx.cbuf = (uint8_t *)bctx.jcr->compress.buffer + OFFSET_FADDR_SIZE + sizeof(comp_stream_header);
bctx.max_compress_len = bctx.jcr->compress.buffer_size - (sizeof(comp_stream_header) + OFFSET_FADDR_SIZE);
} else {
bctx.chead = (Bytef *)bctx.jcr->compress.buffer;
bctx.cbuf = (Bytef *)bctx.jcr->compress.buffer + sizeof(comp_stream_header);
bctx.chead = (uint8_t *)bctx.jcr->compress.buffer;
bctx.cbuf = (uint8_t *)bctx.jcr->compress.buffer + sizeof(comp_stream_header);
bctx.max_compress_len = bctx.jcr->compress.buffer_size - sizeof(comp_stream_header);
}

Expand All @@ -121,10 +121,10 @@ bool setup_compression_context(b_ctx &bctx)
bctx.chead = NULL;
if ((bctx.ff_pkt->flags & FO_SPARSE) ||
(bctx.ff_pkt->flags & FO_OFFSETS)) {
bctx.cbuf = (Bytef *)bctx.jcr->compress.buffer + OFFSET_FADDR_SIZE;
bctx.cbuf = (uint8_t *)bctx.jcr->compress.buffer + OFFSET_FADDR_SIZE;
bctx.max_compress_len = bctx.jcr->compress.buffer_size - OFFSET_FADDR_SIZE;
} else {
bctx.cbuf = (Bytef *)bctx.jcr->compress.buffer;
bctx.cbuf = (uint8_t *)bctx.jcr->compress.buffer;
bctx.max_compress_len = bctx.jcr->compress.buffer_size;
}
bctx.wbuf = bctx.jcr->compress.buffer; /* compressed output here */
Expand Down
5 changes: 5 additions & 0 deletions src/lib/compression.c
Expand Up @@ -687,7 +687,12 @@ bool decompress_data(JCR *jcr, const char *last_fname, int32_t stream, char **da
break;
}
default:
#ifdef HAVE_LIBZ
return decompress_with_zlib(jcr, last_fname, data, length, false);
#else
Qmsg(jcr, M_ERROR, 0, _("Compression algorithm GZIP found, but not supported!\n"));
return false;
#endif
}
}

Expand Down

0 comments on commit b40d1ff

Please sign in to comment.