1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-12 11:45:24 +02:00

Make changes for C89

This commit is contained in:
Arthur Zakirov 2019-04-04 20:26:36 +03:00
parent 514a01dc15
commit 1746b54978
2 changed files with 11 additions and 6 deletions

View File

@ -476,7 +476,7 @@ pgBackupCreateDir(pgBackup *backup)
parray *external_list;
external_list = make_external_directory_list(backup->external_dir_str);
for (int i = 0; i < parray_num(external_list); i++)
for (i = 0; i < parray_num(external_list); i++)
{
char temp[MAXPGPATH];
/* Numeration of externaldirs starts with 1 */

View File

@ -673,10 +673,12 @@ merge_files(void *arg)
static void
remove_dir_with_files(const char *path)
{
parray *files = parray_new();
parray *files = parray_new();
int i;
dir_list_file(files, path, true, true, true, 0);
parray_qsort(files, pgFileComparePathDesc);
for (int i = 0; i < parray_num(files); i++)
for (i = 0; i < parray_num(files); i++)
{
pgFile *file = (pgFile *) parray_get(files, i);
@ -689,9 +691,11 @@ remove_dir_with_files(const char *path)
static int
get_external_index(const char *key, const parray *list)
{
int i;
if (!list) /* Nowhere to search */
return -1;
for (int i = 0; i < parray_num(list); i++)
for (i = 0; i < parray_num(list); i++)
{
if (strcmp(key, parray_get(list, i)) == 0)
return i + 1;
@ -704,11 +708,12 @@ static void
reorder_external_dirs(pgBackup *to_backup, parray *to_external,
parray *from_external)
{
char externaldir_template[MAXPGPATH];
char externaldir_template[MAXPGPATH];
int i;
pgBackupGetPath(to_backup, externaldir_template,
lengthof(externaldir_template), EXTERNAL_DIR);
for (int i = 0; i < parray_num(to_external); i++)
for (i = 0; i < parray_num(to_external); i++)
{
int from_num = get_external_index(parray_get(to_external, i),
from_external);