From af143b8d549ec010c024d4928d79336e3c0e2108 Mon Sep 17 00:00:00 2001 From: yuqing Date: Thu, 7 Jun 2018 20:47:27 +0800 Subject: [PATCH] correct CRC32, you must upgrade libfastcommon to V1.38 or later --- HISTORY | 3 ++- client/fdfs_crc32.c | 4 ++-- storage/storage_nio.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index b745b969..4af2eedb 100644 --- a/HISTORY +++ b/HISTORY @@ -1,9 +1,10 @@ -Version 5.12 2018-05-23 +Version 5.12 2018-06-07 * code refine for rare case * replace print format OFF_PRINTF_FORMAT to PRId64 * php_ext fix zend_object_store_get_object call in php5.5 * make.sh uses macros define in /usr/include/fastcommon/_os_define.h + * correct CRC32, you must upgrade libfastcommon to V1.38 or later Version 5.11 2017-05-26 * bug fixed: file_offset has no effect when use trunk file diff --git a/client/fdfs_crc32.c b/client/fdfs_crc32.c index b460197f..f8d75223 100644 --- a/client/fdfs_crc32.c +++ b/client/fdfs_crc32.c @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) int fd; int read_bytes; int result; - int crc32; + int64_t crc32; char buff[512 * 1024]; if (argc < 2) @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) if (result == 0) { crc32 = CRC32_FINAL(crc32); - printf("%u\n", crc32); + printf("%x\n", (int)crc32); } return result; diff --git a/storage/storage_nio.h b/storage/storage_nio.h index 7a14458c..632362c3 100644 --- a/storage/storage_nio.h +++ b/storage/storage_nio.h @@ -91,7 +91,7 @@ typedef struct bool calc_file_hash; //if calculate file content hash code int open_flags; //open file flags int file_hash_codes[4]; //file hash code - int crc32; //file content crc32 signature + int64_t crc32; //file content crc32 signature MD5_CTX md5_context; union