aboutsummaryrefslogtreecommitdiff
path: root/serve_image.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-01 14:10:21 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-01 14:31:52 +0300
commit8ab9e98ce27487c40289664d6cb1a58f963679cb (patch)
tree030ab5ecebdd08767bc34e0fb08f14b2d361c34b /serve_image.c
parentf49f5405d6baeaf074b1803a6abc116caf130b9d (diff)
rename crc32 to mtd_crc32
Because of namespace collisions mkfs.ubifs uses crc32() implementation from /lib/libz.so.1, which generates incompatible CRC and later on the kernel reports many CRC errors. Fix this by re-naming mtd-utils' crc32 function to mtd_crc32. Reported-by: Jon Povey <Jon.Povey@racelogic.co.uk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'serve_image.c')
-rw-r--r--serve_image.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/serve_image.c b/serve_image.c
index 5aafa35..4b5dba9 100644
--- a/serve_image.c
+++ b/serve_image.c
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
fflush(stdout);
pktbuf.hdr.resend = 0;
- pktbuf.hdr.totcrc = htonl(crc32(-1, image, st.st_size));
+ pktbuf.hdr.totcrc = htonl(mtd_crc32(-1, image, st.st_size));
pktbuf.hdr.nr_blocks = htonl(nr_blocks);
pktbuf.hdr.blocksize = htonl(erasesize);
pktbuf.hdr.thislen = htonl(PKT_SIZE);
@@ -163,7 +163,7 @@ int main(int argc, char **argv)
printf("\rChecking block CRCS.... %d/%d",
block_nr + 1, nr_blocks);
fflush(stdout);
- block_crcs[block_nr] = crc32(-1, image + (block_nr * erasesize), erasesize);
+ block_crcs[block_nr] = mtd_crc32(-1, image + (block_nr * erasesize), erasesize);
}
printf("\nImage size %ld KiB (0x%08lx). %d blocks at %d pkts/block\n"
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
fec_encode_linear(fec, blockptr, pktbuf.data, actualpkt, PKT_SIZE);
- pktbuf.hdr.thiscrc = htonl(crc32(-1, pktbuf.data, PKT_SIZE));
+ pktbuf.hdr.thiscrc = htonl(mtd_crc32(-1, pktbuf.data, PKT_SIZE));
pktbuf.hdr.block_crc = htonl(block_crcs[block_nr]);
pktbuf.hdr.block_nr = htonl(block_nr);
pktbuf.hdr.pkt_nr = htons(actualpkt);