mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-09 14:45:47 +02:00
PGPRO-1759: Fix messages and variable names, it should be data not date
This commit is contained in:
parent
3080228453
commit
be8f3be6cd
@ -250,14 +250,14 @@ IsDir(const char *dirpath, const char *entry)
|
|||||||
parray *
|
parray *
|
||||||
catalog_get_backup_list(time_t requested_backup_id)
|
catalog_get_backup_list(time_t requested_backup_id)
|
||||||
{
|
{
|
||||||
DIR *date_dir = NULL;
|
DIR *data_dir = NULL;
|
||||||
struct dirent *date_ent = NULL;
|
struct dirent *data_ent = NULL;
|
||||||
parray *backups = NULL;
|
parray *backups = NULL;
|
||||||
pgBackup *backup = NULL;
|
pgBackup *backup = NULL;
|
||||||
|
|
||||||
/* open backup instance backups directory */
|
/* open backup instance backups directory */
|
||||||
date_dir = opendir(backup_instance_path);
|
data_dir = opendir(backup_instance_path);
|
||||||
if (date_dir == NULL)
|
if (data_dir == NULL)
|
||||||
{
|
{
|
||||||
elog(WARNING, "cannot open directory \"%s\": %s", backup_instance_path,
|
elog(WARNING, "cannot open directory \"%s\": %s", backup_instance_path,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
@ -266,21 +266,21 @@ catalog_get_backup_list(time_t requested_backup_id)
|
|||||||
|
|
||||||
/* scan the directory and list backups */
|
/* scan the directory and list backups */
|
||||||
backups = parray_new();
|
backups = parray_new();
|
||||||
for (; (date_ent = readdir(date_dir)) != NULL; errno = 0)
|
for (; (data_ent = readdir(data_dir)) != NULL; errno = 0)
|
||||||
{
|
{
|
||||||
char backup_conf_path[MAXPGPATH];
|
char backup_conf_path[MAXPGPATH];
|
||||||
char date_path[MAXPGPATH];
|
char data_path[MAXPGPATH];
|
||||||
|
|
||||||
/* skip not-directory entries and hidden entries */
|
/* skip not-directory entries and hidden entries */
|
||||||
if (!IsDir(backup_instance_path, date_ent->d_name)
|
if (!IsDir(backup_instance_path, data_ent->d_name)
|
||||||
|| date_ent->d_name[0] == '.')
|
|| data_ent->d_name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* open subdirectory of specific backup */
|
/* open subdirectory of specific backup */
|
||||||
join_path_components(date_path, backup_instance_path, date_ent->d_name);
|
join_path_components(data_path, backup_instance_path, data_ent->d_name);
|
||||||
|
|
||||||
/* read backup information from BACKUP_CONTROL_FILE */
|
/* read backup information from BACKUP_CONTROL_FILE */
|
||||||
snprintf(backup_conf_path, MAXPGPATH, "%s/%s", date_path, BACKUP_CONTROL_FILE);
|
snprintf(backup_conf_path, MAXPGPATH, "%s/%s", data_path, BACKUP_CONTROL_FILE);
|
||||||
backup = readBackupControlFile(backup_conf_path);
|
backup = readBackupControlFile(backup_conf_path);
|
||||||
|
|
||||||
/* ignore corrupted backups */
|
/* ignore corrupted backups */
|
||||||
@ -298,8 +298,8 @@ catalog_get_backup_list(time_t requested_backup_id)
|
|||||||
|
|
||||||
if (errno && errno != ENOENT)
|
if (errno && errno != ENOENT)
|
||||||
{
|
{
|
||||||
elog(WARNING, "cannot read date directory \"%s\": %s",
|
elog(WARNING, "cannot read data directory \"%s\": %s",
|
||||||
date_ent->d_name, strerror(errno));
|
data_ent->d_name, strerror(errno));
|
||||||
goto err_proc;
|
goto err_proc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -310,16 +310,16 @@ catalog_get_backup_list(time_t requested_backup_id)
|
|||||||
goto err_proc;
|
goto err_proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir(date_dir);
|
closedir(data_dir);
|
||||||
date_dir = NULL;
|
data_dir = NULL;
|
||||||
|
|
||||||
parray_qsort(backups, pgBackupCompareIdDesc);
|
parray_qsort(backups, pgBackupCompareIdDesc);
|
||||||
|
|
||||||
return backups;
|
return backups;
|
||||||
|
|
||||||
err_proc:
|
err_proc:
|
||||||
if (date_dir)
|
if (data_dir)
|
||||||
closedir(date_dir);
|
closedir(data_dir);
|
||||||
if (backup)
|
if (backup)
|
||||||
pgBackupFree(backup);
|
pgBackupFree(backup);
|
||||||
if (backups)
|
if (backups)
|
||||||
|
Loading…
Reference in New Issue
Block a user