}
}
-void file_checksum(char *fname, char *sum, OFF_T size)
+void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
{
struct map_struct *buf;
- OFF_T i, len = size;
+ OFF_T i, len = st_p->st_size;
md_context m;
int32 remainder;
int fd;
if (fd == -1)
return;
- buf = map_file(fd, size, MAX_MAP_SIZE, CSUM_CHUNK);
+ buf = map_file(fd, len, MAX_MAP_SIZE, CSUM_CHUNK);
if (protocol_version >= 30) {
md5_begin(&m);
#endif
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
- file_checksum(thisname, tmp_sum, st.st_size);
+ file_checksum(thisname, &st, tmp_sum);
if (sender_keeps_checksum)
extra_len += SUM_EXTRA_CNT * EXTRA_LEN;
}
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
- file_checksum(fn, sum, st->st_size);
+ file_checksum(fn, st, sum);
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}