@@ -68,7 +68,7 @@ doDeflate(z_stream *zp, size_t in_size, size_t out_size, void *inbuf,
6868}
6969
7070/* update CRC */
71- COMP_CRC32 (* crc ,outbuf ,out_size - zp -> avail_out );
71+ COMP_CRC32C (* crc ,outbuf ,out_size - zp -> avail_out );
7272
7373* write_size += out_size - zp -> avail_out ;
7474
@@ -146,7 +146,7 @@ doInflate(z_stream *zp, size_t in_size, size_t out_size,void *inbuf,
146146}
147147
148148/* update CRC */
149- COMP_CRC32 (* crc ,outbuf ,out_size - zp -> avail_out );
149+ COMP_CRC32C (* crc ,outbuf ,out_size - zp -> avail_out );
150150
151151return status ;
152152}
@@ -216,7 +216,7 @@ backup_data_file(const char *from_root, const char *to_root,
216216z_stream z ;
217217char outbuf [zlibOutSize ];
218218#endif
219- INIT_CRC32 (crc );
219+ INIT_CRC32C (crc );
220220
221221/* reset size summary */
222222file -> read_size = 0 ;
@@ -226,7 +226,7 @@ backup_data_file(const char *from_root, const char *to_root,
226226in = fopen (file -> path ,"r" );
227227if (in == NULL )
228228{
229- FIN_CRC32 (crc );
229+ FIN_CRC32C (crc );
230230file -> crc = crc ;
231231
232232/* maybe vanished, it's not error */
@@ -338,9 +338,9 @@ backup_data_file(const char *from_root, const char *to_root,
338338}
339339
340340/* update CRC */
341- COMP_CRC32 (crc ,& header ,sizeof (header ));
342- COMP_CRC32 (crc ,page .data ,header .hole_offset );
343- COMP_CRC32 (crc ,page .data + upper_offset ,upper_length );
341+ COMP_CRC32C (crc ,& header ,sizeof (header ));
342+ COMP_CRC32C (crc ,page .data ,header .hole_offset );
343+ COMP_CRC32C (crc ,page .data + upper_offset ,upper_length );
344344
345345file -> write_size += sizeof (header )+ read_len - header .hole_length ;
346346}
@@ -393,7 +393,7 @@ backup_data_file(const char *from_root, const char *to_root,
393393_ ("can't write at block %u of \"%s\": %s" ),
394394blknum ,to_path ,strerror (errno_tmp ));
395395}
396- COMP_CRC32 (crc ,& header ,sizeof (header ));
396+ COMP_CRC32C (crc ,& header ,sizeof (header ));
397397file -> write_size += sizeof (header );
398398}
399399}
@@ -418,7 +418,7 @@ backup_data_file(const char *from_root, const char *to_root,
418418blknum ,to_path ,strerror (errno_tmp ));
419419}
420420
421- COMP_CRC32 (crc ,page .data ,read_len );
421+ COMP_CRC32C (crc ,page .data ,read_len );
422422file -> write_size += read_len ;
423423}
424424
@@ -462,7 +462,7 @@ backup_data_file(const char *from_root, const char *to_root,
462462fclose (out );
463463
464464/* finish CRC calculation and store into pgFile */
465- FIN_CRC32 (crc );
465+ FIN_CRC32C (crc );
466466file -> crc = crc ;
467467
468468/* Treat empty file as not-datafile */
@@ -553,7 +553,7 @@ restore_data_file(const char *from_root,
553553if (inflateInit (& z )!= Z_OK )
554554elog (ERROR_SYSTEM ,_ ("can't initialize compression library: %s" ),
555555z .msg );
556- INIT_CRC32 (crc );
556+ INIT_CRC32C (crc );
557557read_size = 0 ;
558558}
559559#endif
@@ -700,7 +700,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
700700char outbuf [zlibOutSize ];
701701char inbuf [zlibInSize ];
702702#endif
703- INIT_CRC32 (crc );
703+ INIT_CRC32C (crc );
704704
705705/* reset size summary */
706706file -> read_size = 0 ;
@@ -710,7 +710,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
710710in = fopen (file -> path ,"r" );
711711if (in == NULL )
712712{
713- FIN_CRC32 (crc );
713+ FIN_CRC32C (crc );
714714file -> crc = crc ;
715715
716716/* maybe deleted, it's not error */
@@ -825,7 +825,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
825825strerror (errno_tmp ));
826826}
827827/* update CRC */
828- COMP_CRC32 (crc ,buf ,read_len );
828+ COMP_CRC32C (crc ,buf ,read_len );
829829
830830file -> write_size += sizeof (buf );
831831file -> read_size += sizeof (buf );
@@ -862,7 +862,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
862862strerror (errno_tmp ));
863863}
864864/* update CRC */
865- COMP_CRC32 (crc ,buf ,read_len );
865+ COMP_CRC32C (crc ,buf ,read_len );
866866
867867file -> write_size += read_len ;
868868}
@@ -900,7 +900,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
900900
901901#endif
902902/* finish CRC calculation and store into pgFile */
903- FIN_CRC32 (crc );
903+ FIN_CRC32C (crc );
904904file -> crc = crc ;
905905
906906/* update file permission */