summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorGustavo Zacarias2016-10-10 22:54:24 +0200
committerKarel Zak2016-10-19 12:11:59 +0200
commit7f0d4d56a2f1ed34c3da4501e65fb79497b3dda1 (patch)
treeeeca870689c5084128ffa5a49c845d2c19df308c /disk-utils
parentfstrim: add -v to the systemd service (diff)
downloadkernel-qcow2-util-linux-7f0d4d56a2f1ed34c3da4501e65fb79497b3dda1.tar.gz
kernel-qcow2-util-linux-7f0d4d56a2f1ed34c3da4501e65fb79497b3dda1.tar.xz
kernel-qcow2-util-linux-7f0d4d56a2f1ed34c3da4501e65fb79497b3dda1.zip
lib/crc32: prefix public functions
Make the publicly-visible crc32 library functions prefixed by ul_, such as crc32() -> ul_crc32(). This is because it clashes with the crc32() function from zlib. For newer versions of glib (2.50+) zlib and libblkid are required dependencies and otherwise results in build failure when building statically. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/fsck.cramfs.c12
-rw-r--r--disk-utils/mkfs.cramfs.c6
2 files changed, 9 insertions, 9 deletions
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index 12009f21c..f34e79f90 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -214,7 +214,7 @@ static void test_crc(int start)
return;
}
- crc = crc32(0L, Z_NULL, 0);
+ crc = ul_crc32(0L, Z_NULL, 0);
buf =
mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
@@ -231,8 +231,8 @@ static void test_crc(int start)
}
if (buf != MAP_FAILED) {
((struct cramfs_super *)((unsigned char *) buf + start))->fsid.crc =
- crc32(0L, Z_NULL, 0);
- crc = crc32(crc, (unsigned char *) buf + start, super.size - start);
+ ul_crc32(0L, Z_NULL, 0);
+ crc = ul_crc32(crc, (unsigned char *) buf + start, super.size - start);
munmap(buf, super.size);
} else {
int retval;
@@ -249,15 +249,15 @@ static void test_crc(int start)
break;
if (length == 0)
((struct cramfs_super *)buf)->fsid.crc =
- crc32(0L, Z_NULL, 0);
+ ul_crc32(0L, Z_NULL, 0);
length += retval;
if (length > (super.size - start)) {
- crc = crc32(crc, buf,
+ crc = ul_crc32(crc, buf,
retval - (length -
(super.size - start)));
break;
}
- crc = crc32(crc, buf, retval);
+ crc = ul_crc32(crc, buf, retval);
}
free(buf);
}
diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index 4e6b3ab85..55d68716b 100644
--- a/disk-utils/mkfs.cramfs.c
+++ b/disk-utils/mkfs.cramfs.c
@@ -406,7 +406,7 @@ static unsigned int write_superblock(struct entry *root, char *base, int size)
super->size = size;
memcpy(super->signature, CRAMFS_SIGNATURE, sizeof(super->signature));
- super->fsid.crc = crc32(0L, Z_NULL, 0);
+ super->fsid.crc = ul_crc32(0L, Z_NULL, 0);
super->fsid.edition = opt_edition;
super->fsid.blocks = total_blocks;
super->fsid.files = total_nodes;
@@ -700,7 +700,7 @@ int main(int argc, char **argv)
loff_t fslen_ub = sizeof(struct cramfs_super);
unsigned int fslen_max;
char const *dirname, *outfile;
- uint32_t crc = crc32(0L, Z_NULL, 0);
+ uint32_t crc = ul_crc32(0L, Z_NULL, 0);
int c;
cramfs_is_big_endian = HOST_IS_BIG_ENDIAN; /* default is to use host order */
@@ -856,7 +856,7 @@ int main(int argc, char **argv)
sizeof(struct cramfs_super));
/* Put the checksum in. */
- crc = crc32(crc, (unsigned char *) (rom_image+opt_pad), (offset-opt_pad));
+ crc = ul_crc32(crc, (unsigned char *) (rom_image+opt_pad), (offset-opt_pad));
((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = u32_toggle_endianness(cramfs_is_big_endian, crc);
if (verbose)
printf(_("CRC: %x\n"), crc);