From 765524854cf08239729746c3138fb24a294af702 Mon Sep 17 00:00:00 2001 From: Anastasia Date: Tue, 26 Sep 2017 20:13:23 +0300 Subject: [PATCH] do not call calc_checksum for non regular files. add an Assert --- src/backup.c | 3 ++- src/data.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backup.c b/src/backup.c index 531c9c69..dfa2193f 100644 --- a/src/backup.c +++ b/src/backup.c @@ -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); diff --git a/src/data.c b/src/data.c index cb3d856f..74cc85e4 100644 --- a/src/data.c +++ b/src/data.c @@ -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 */