Skip to content

Commit 585f1ab

Browse files
committed
[Issue #271] when updating backup status overwrite control file only if status has changed
1 parent 98372aa commit 585f1ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/catalog.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ write_backup_status(pgBackup *backup, BackupStatus status,
120120
return;
121121
}
122122

123+
/* overwrite control file only if status has changed */
124+
if (backup->status == status)
125+
{
126+
pgBackupFree(tmp);
127+
return;
128+
}
129+
123130
backup->status = status;
124131
tmp->status = backup->status;
125132
tmp->root_dir = pgut_strdup(backup->root_dir);

0 commit comments

Comments
 (0)