1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-03 09:59:53 +02:00

do not call calc_checksum for non regular files. add an Assert

This commit is contained in:
Anastasia 2017-09-26 20:13:23 +03:00
parent a5e8a54d82
commit 765524854c
2 changed files with 3 additions and 1 deletions

View File

@ -1230,7 +1230,8 @@ pg_stop_backup(pgBackup *backup)
if (backup_files_list)
{
file = pgFileNew(tablespace_map, true);
calc_file_checksum(file);
if (S_ISREG(file->mode))
calc_file_checksum(file);
free(file->path);
file->path = strdup(PG_TABLESPACE_MAP_FILE);
parray_append(backup_files_list, file);

View File

@ -997,6 +997,7 @@ calc_file_checksum(pgFile *file)
struct stat st;
pg_crc32 crc;
Assert(S_ISREG(file->mode));
INIT_CRC32C(crc);
/* reset size summary */