summaryrefslogtreecommitdiff
path: root/recv_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 /recv_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 'recv_image.c')
-rw-r--r--recv_image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/recv_image.c b/recv_image.c
index 60b24b3..617711c 100644
--- a/recv_image.c
+++ b/recv_image.c
@@ -244,10 +244,10 @@ int main(int argc, char **argv)
continue;
}
- if (crc32(-1, thispkt.data, PKT_SIZE) != ntohl(thispkt.hdr.thiscrc)) {
+ if (mtd_crc32(-1, thispkt.data, PKT_SIZE) != ntohl(thispkt.hdr.thiscrc)) {
printf("\nDiscard %08x pkt %d with bad CRC (%08x not %08x)\n",
block_nr * meminfo.erasesize, ntohs(thispkt.hdr.pkt_nr),
- crc32(-1, thispkt.data, PKT_SIZE),
+ mtd_crc32(-1, thispkt.data, PKT_SIZE),
ntohl(thispkt.hdr.thiscrc));
badcrcs++;
continue;
@@ -393,10 +393,10 @@ int main(int argc, char **argv)
/* Paranoia */
gettimeofday(&start, NULL);
- if (crc32(-1, decode_buf, meminfo.erasesize) != eraseblocks[block_nr].crc) {
+ if (mtd_crc32(-1, decode_buf, meminfo.erasesize) != eraseblocks[block_nr].crc) {
printf("\nCRC mismatch for block #%d: want %08x got %08x\n",
block_nr, eraseblocks[block_nr].crc,
- crc32(-1, decode_buf, meminfo.erasesize));
+ mtd_crc32(-1, decode_buf, meminfo.erasesize));
exit(1);
}
gettimeofday(&now, NULL);