summaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 16:09:31 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 22:53:32 +0200
commit50385e06ec207af0171c021f1909e9ef38c00519 (patch)
tree690bfe53cef9f901c68f76f4fe50c1917e368fe2 /lib/sqfs/data_writer.c
parent58c5d7c933a714096ef0dd42bd1446a6e1a25a16 (diff)
Replace update_crc32 helper function with crc32 from zlib
It is optimized to the maximum and if we already use zlib anyway, why not use zlib crc32? This also makes zlib a hard dependency which also means the whole "do we have a compressor" sanity check in the build system can be removed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/data_writer.c')
-rw-r--r--lib/sqfs/data_writer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqfs/data_writer.c b/lib/sqfs/data_writer.c
index 55c92ad..c584f1e 100644
--- a/lib/sqfs/data_writer.c
+++ b/lib/sqfs/data_writer.c
@@ -16,6 +16,7 @@
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
+#include <zlib.h>
struct data_writer_t {
block_t *frag_block;
@@ -229,7 +230,7 @@ static int handle_fragment(data_writer_t *data, block_t *blk)
{
file_info_t *fi = blk->user, *ref;
- fi->fragment_chksum = update_crc32(0, blk->data, blk->size);
+ fi->fragment_chksum = crc32(0, blk->data, blk->size);
ref = fragment_by_chksum(fi, fi->fragment_chksum, blk->size,
data->list, data->super->block_size);