Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 73496c4

Browse files
committed
Fix broken tests.validate.ValidateTest.test_validate_instance_with_several_corrupt_backups_interrupt
+fix small typo introduced in 02a3665
1 parent fc752c8 commit 73496c4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/catalog.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ static int grab_excl_lock_file(const char *backup_dir, const char *backup_id, bo
3232
static int grab_shared_lock_file(pgBackup *backup);
3333
static int wait_shared_owners(pgBackup *backup);
3434

35+
36+
static void unlink_lock_atexit(bool fatal, void *userdata);
3537
static void unlock_backup(const char *backup_dir, const char *backup_id, bool exclusive);
3638
static void release_excl_lock_file(const char *backup_dir);
3739
static void release_shared_lock_file(const char *backup_dir);
@@ -83,8 +85,8 @@ timelineInfoFree(void *tliInfo)
8385
}
8486

8587
/* Iterate over locked backups and unlock them */
86-
static void
87-
unlink_lock_atexit(void)
88+
void
89+
unlink_lock_atexit(bool unused_fatal, void *unused_userdata)
8890
{
8991
int i;
9092

@@ -94,7 +96,7 @@ unlink_lock_atexit(void)
9496
for (i = 0; i < parray_num(locks); i++)
9597
{
9698
LockInfo *lock = (LockInfo *) parray_get(locks, i);
97-
unlock_backup(lock->backup_dir, lock->backup_dir, lock->exclusive);
99+
unlock_backup(lock->backup_dir, lock->backup_id, lock->exclusive);
98100
}
99101

100102
parray_walk(locks, pg_free);
@@ -267,7 +269,7 @@ lock_backup(pgBackup *backup, bool strict, bool exclusive)
267269
*/
268270
if (!backup_lock_exit_hook_registered)
269271
{
270-
atexit(unlink_lock_atexit);
272+
pgut_atexit_push(unlink_lock_atexit, NULL);
271273
backup_lock_exit_hook_registered = true;
272274
}
273275

0 commit comments

Comments
 (0)