@@ -68,7 +68,7 @@ doDeflate(z_stream *zp, size_t in_size, size_t out_size, void *inbuf,
68
68
}
69
69
70
70
/* update CRC */
71
- COMP_CRC32 (* crc ,outbuf ,out_size - zp -> avail_out );
71
+ COMP_CRC32C (* crc ,outbuf ,out_size - zp -> avail_out );
72
72
73
73
* write_size += out_size - zp -> avail_out ;
74
74
@@ -146,7 +146,7 @@ doInflate(z_stream *zp, size_t in_size, size_t out_size,void *inbuf,
146
146
}
147
147
148
148
/* update CRC */
149
- COMP_CRC32 (* crc ,outbuf ,out_size - zp -> avail_out );
149
+ COMP_CRC32C (* crc ,outbuf ,out_size - zp -> avail_out );
150
150
151
151
return status ;
152
152
}
@@ -216,7 +216,7 @@ backup_data_file(const char *from_root, const char *to_root,
216
216
z_stream z ;
217
217
char outbuf [zlibOutSize ];
218
218
#endif
219
- INIT_CRC32 (crc );
219
+ INIT_CRC32C (crc );
220
220
221
221
/* reset size summary */
222
222
file -> read_size = 0 ;
@@ -226,7 +226,7 @@ backup_data_file(const char *from_root, const char *to_root,
226
226
in = fopen (file -> path ,"r" );
227
227
if (in == NULL )
228
228
{
229
- FIN_CRC32 (crc );
229
+ FIN_CRC32C (crc );
230
230
file -> crc = crc ;
231
231
232
232
/* maybe vanished, it's not error */
@@ -338,9 +338,9 @@ backup_data_file(const char *from_root, const char *to_root,
338
338
}
339
339
340
340
/* 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 );
344
344
345
345
file -> write_size += sizeof (header )+ read_len - header .hole_length ;
346
346
}
@@ -393,7 +393,7 @@ backup_data_file(const char *from_root, const char *to_root,
393
393
_ ("can't write at block %u of \"%s\": %s" ),
394
394
blknum ,to_path ,strerror (errno_tmp ));
395
395
}
396
- COMP_CRC32 (crc ,& header ,sizeof (header ));
396
+ COMP_CRC32C (crc ,& header ,sizeof (header ));
397
397
file -> write_size += sizeof (header );
398
398
}
399
399
}
@@ -418,7 +418,7 @@ backup_data_file(const char *from_root, const char *to_root,
418
418
blknum ,to_path ,strerror (errno_tmp ));
419
419
}
420
420
421
- COMP_CRC32 (crc ,page .data ,read_len );
421
+ COMP_CRC32C (crc ,page .data ,read_len );
422
422
file -> write_size += read_len ;
423
423
}
424
424
@@ -462,7 +462,7 @@ backup_data_file(const char *from_root, const char *to_root,
462
462
fclose (out );
463
463
464
464
/* finish CRC calculation and store into pgFile */
465
- FIN_CRC32 (crc );
465
+ FIN_CRC32C (crc );
466
466
file -> crc = crc ;
467
467
468
468
/* Treat empty file as not-datafile */
@@ -553,7 +553,7 @@ restore_data_file(const char *from_root,
553
553
if (inflateInit (& z )!= Z_OK )
554
554
elog (ERROR_SYSTEM ,_ ("can't initialize compression library: %s" ),
555
555
z .msg );
556
- INIT_CRC32 (crc );
556
+ INIT_CRC32C (crc );
557
557
read_size = 0 ;
558
558
}
559
559
#endif
@@ -700,7 +700,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
700
700
char outbuf [zlibOutSize ];
701
701
char inbuf [zlibInSize ];
702
702
#endif
703
- INIT_CRC32 (crc );
703
+ INIT_CRC32C (crc );
704
704
705
705
/* reset size summary */
706
706
file -> read_size = 0 ;
@@ -710,7 +710,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
710
710
in = fopen (file -> path ,"r" );
711
711
if (in == NULL )
712
712
{
713
- FIN_CRC32 (crc );
713
+ FIN_CRC32C (crc );
714
714
file -> crc = crc ;
715
715
716
716
/* maybe deleted, it's not error */
@@ -825,7 +825,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
825
825
strerror (errno_tmp ));
826
826
}
827
827
/* update CRC */
828
- COMP_CRC32 (crc ,buf ,read_len );
828
+ COMP_CRC32C (crc ,buf ,read_len );
829
829
830
830
file -> write_size += sizeof (buf );
831
831
file -> read_size += sizeof (buf );
@@ -862,7 +862,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
862
862
strerror (errno_tmp ));
863
863
}
864
864
/* update CRC */
865
- COMP_CRC32 (crc ,buf ,read_len );
865
+ COMP_CRC32C (crc ,buf ,read_len );
866
866
867
867
file -> write_size += read_len ;
868
868
}
@@ -900,7 +900,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
900
900
901
901
#endif
902
902
/* finish CRC calculation and store into pgFile */
903
- FIN_CRC32 (crc );
903
+ FIN_CRC32C (crc );
904
904
file -> crc = crc ;
905
905
906
906
/* update file permission */